{"action":"created","issue":{"url":"https://api.github.com/repos/gin-gonic/gin/issues/742","repository_url":"https://api.github.com/repos/gin-gonic/gin","labels_url":"https://api.github.com/repos/gin-gonic/gin/issues/742/labels{/name}","comments_url":"https://api.github.com/repos/gin-gonic/gin/issues/742/comments","events_url":"https://api.github.com/repos/gin-gonic/gin/issues/742/events","html_url":"https://github.com/gin-gonic/gin/issues/742","id":189789445,"number":742,"title":"how to bind query string?","user":{"login":"selvam347","id":10445796,"avatar_url":"https://avatars.githubusercontent.com/u/10445796?v=3","gravatar_id":"","url":"https://api.github.com/users/selvam347","html_url":"https://github.com/selvam347","followers_url":"https://api.github.com/users/selvam347/followers","following_url":"https://api.github.com/users/selvam347/following{/other_user}","gists_url":"https://api.github.com/users/selvam347/gists{/gist_id}","starred_url":"https://api.github.com/users/selvam347/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/selvam347/subscriptions","organizations_url":"https://api.github.com/users/selvam347/orgs","repos_url":"https://api.github.com/users/selvam347/repos","events_url":"https://api.github.com/users/selvam347/events{/privacy}","received_events_url":"https://api.github.com/users/selvam347/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-16T17:53:24Z","updated_at":"2016-12-04T03:07:41Z","closed_at":"2016-12-03T16:04:43Z","body":"```\r\npackage main\r\n\r\nimport \"log\"\r\nimport \"github.com/gin-gonic/gin\"\r\n\r\ntype Person struct {\r\n\tName    string `json:\"name\"`\r\n\tAddress string `json:\"address\"`\r\n}\r\n\r\nfunc main() {\r\n\tlog.Println(\"Hello World\")\r\n\troute := gin.Default()\r\n\troute.GET(\"/testing\", startPage)\r\n\troute.Run(\":8085\")\r\n}\r\n\r\nfunc startPage(c *gin.Context) {\r\n\tvar person Person\r\n\tif c.BindJSON(&person) == nil {\r\n\t\tlog.Println(person.Name)\r\n\t\tlog.Println(person.Address)\r\n\t\tlog.Println(\"Binding success...............\")\r\n\t} else {\r\n\t\tlog.Println(\"Binding failed...............\")\r\n\t}\r\n\r\n\tc.String(200, \"Success\")\r\n}\r\n\r\n```\r\nThe above code works only for `curl -X GET localhost:8085/testing --data '{\"name\":\"JJ\", \"address\":\"xyz\"}' -H \"Content-Type:application/json\"` but not `curl -X GET localhost:8085/testing?name=JJ&address=xyz  -H \"Content-Type:application/json\"`\r\n\r\nif i use `c.Bind(&person)`, binding failed  both case.\r\nHow can i write the above code which binds both query string and json."},"comment":{"url":"https://api.github.com/repos/gin-gonic/gin/issues/comments/264681427","html_url":"https://github.com/gin-gonic/gin/issues/742#issuecomment-264681427","issue_url":"https://api.github.com/repos/gin-gonic/gin/issues/742","id":264681427,"user":{"login":"appleboy","id":21979,"avatar_url":"https://avatars.githubusercontent.com/u/21979?v=3","gravatar_id":"","url":"https://api.github.com/users/appleboy","html_url":"https://github.com/appleboy","followers_url":"https://api.github.com/users/appleboy/followers","following_url":"https://api.github.com/users/appleboy/following{/other_user}","gists_url":"https://api.github.com/users/appleboy/gists{/gist_id}","starred_url":"https://api.github.com/users/appleboy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/appleboy/subscriptions","organizations_url":"https://api.github.com/users/appleboy/orgs","repos_url":"https://api.github.com/users/appleboy/repos","events_url":"https://api.github.com/users/appleboy/events{/privacy}","received_events_url":"https://api.github.com/users/appleboy/received_events","type":"User","site_admin":false},"created_at":"2016-12-04T03:07:41Z","updated_at":"2016-12-04T03:07:41Z","body":"@jasonab @ei-grad I will update document asap."}}
{"actor":{"display_login":"appleboy"}}