Skip to content

Instantly share code, notes, and snippets.

@bussiere
Created November 28, 2018 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bussiere/4900c63ff22555594a0534e7b5da8b4f to your computer and use it in GitHub Desktop.
Save bussiere/4900c63ff22555594a0534e7b5da8b4f to your computer and use it in GitHub Desktop.
receive json in go with gin
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