Created
November 28, 2018 10:11
-
-
Save bussiere/4900c63ff22555594a0534e7b5da8b4f to your computer and use it in GitHub Desktop.
receive json in go with gin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
v1.POST("/login", func(c *gin.Context) { | |
var loginCmd LoginCommand | |
c.BindJSON(&loginCmd) | |
c.JSON(http.StatusOK, gin.H{"user": loginCmd.Username}) | |
}) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment