{"action":"created","issue":{"url":"https://api.github.com/repos/labstack/echo/issues/574","repository_url":"https://api.github.com/repos/labstack/echo","labels_url":"https://api.github.com/repos/labstack/echo/issues/574/labels{/name}","comments_url":"https://api.github.com/repos/labstack/echo/issues/574/comments","events_url":"https://api.github.com/repos/labstack/echo/issues/574/events","html_url":"https://github.com/labstack/echo/issues/574","id":161004593,"number":574,"title":"Conext.Bind() can not bind GET method queryParams","user":{"login":"weisd","id":2057561,"avatar_url":"https://avatars.githubusercontent.com/u/2057561?v=3","gravatar_id":"","url":"https://api.github.com/users/weisd","html_url":"https://github.com/weisd","followers_url":"https://api.github.com/users/weisd/followers","following_url":"https://api.github.com/users/weisd/following{/other_user}","gists_url":"https://api.github.com/users/weisd/gists{/gist_id}","starred_url":"https://api.github.com/users/weisd/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/weisd/subscriptions","organizations_url":"https://api.github.com/users/weisd/orgs","repos_url":"https://api.github.com/users/weisd/repos","events_url":"https://api.github.com/users/weisd/events{/privacy}","received_events_url":"https://api.github.com/users/weisd/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-06-18T03:33:31Z","updated_at":"2016-06-18T19:28:23Z","closed_at":null,"body":"### Description\r\nConext.Bind() can not bind GET method queryParams\r\n\r\nupdate Bind() like this works fine\r\n```\r\nfunc (b *binder) Bind(i interface{}, c Context) (err error) {\r\n\treq := c.Request()\r\n\tctype := req.Header().Get(HeaderContentType)\r\n\tif req.Body() == nil {\r\n\t\terr = NewHTTPError(http.StatusBadRequest, \"request body can't be empty\")\r\n\t\treturn\r\n\t}\r\n        // default ContentType \r\n\tif len(ctype) == 0 {\r\n\t\tctype = MIMEApplicationForm\r\n\t}\r\n\terr = ErrUnsupportedMediaType\r\n\tswitch {\r\n\tcase strings.HasPrefix(ctype, MIMEApplicationJSON):\r\n\t\tif err = json.NewDecoder(req.Body()).Decode(i); err != nil {\r\n\t\t\terr = NewHTTPError(http.StatusBadRequest, err.Error())\r\n\t\t}\r\n\tcase strings.HasPrefix(ctype, MIMEApplicationXML):\r\n\t\tif err = xml.NewDecoder(req.Body()).Decode(i); err != nil {\r\n\t\t\terr = NewHTTPError(http.StatusBadRequest, err.Error())\r\n\t\t}\r\n\tcase strings.HasPrefix(ctype, MIMEApplicationForm), strings.HasPrefix(ctype, MIMEMultipartForm):\r\n\t\t// add QueryParams suport\r\n                var params map[string][]string\r\n\t\tif c.Request().Method() == \"GET\" {\r\n\t\t\tparams = c.QueryParams()\r\n\t\t} else {\r\n\t\t\tparams = req.FormParams()\r\n\t\t}\r\n\t\tif err = b.bindForm(i, params); err != nil {\r\n\t\t\terr = NewHTTPError(http.StatusBadRequest, err.Error())\r\n\t\t}\r\n\t}\r\n\treturn\r\n}\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/labstack/echo/issues/comments/226960667","html_url":"https://github.com/labstack/echo/issues/574#issuecomment-226960667","issue_url":"https://api.github.com/repos/labstack/echo/issues/574","id":226960667,"user":{"login":"o1egl","id":966539,"avatar_url":"https://avatars.githubusercontent.com/u/966539?v=3","gravatar_id":"","url":"https://api.github.com/users/o1egl","html_url":"https://github.com/o1egl","followers_url":"https://api.github.com/users/o1egl/followers","following_url":"https://api.github.com/users/o1egl/following{/other_user}","gists_url":"https://api.github.com/users/o1egl/gists{/gist_id}","starred_url":"https://api.github.com/users/o1egl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/o1egl/subscriptions","organizations_url":"https://api.github.com/users/o1egl/orgs","repos_url":"https://api.github.com/users/o1egl/repos","events_url":"https://api.github.com/users/o1egl/events{/privacy}","received_events_url":"https://api.github.com/users/o1egl/received_events","type":"User","site_admin":false},"created_at":"2016-06-18T19:28:23Z","updated_at":"2016-06-18T19:28:23Z","body":"```go\r\ncase strings.HasPrefix(ctype, MIMEApplicationForm), strings.HasPrefix(ctype, MIMEMultipartForm)\r\n```\r\nthis case is never pass in GET request."}}
{"actor":{"display_login":"o1egl"}}