-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to bind query parameters after update #1932
Comments
I just saw the line
Since I'm using a POST I guess this is no longer supported. |
atm use as a workaround req := new(Request)
if err := (&echo.DefaultBinder{}).BindQueryParams(c, req); err != nil {
return err
} binding query params for POST methods was disabled because even public fields (without tags) were bound from query params. But with change "only explicit tags are bound" (v4.2.0 I think) we could allow it. |
Note: if you used POST and also there we many other problems with binding query params that way. see: #1670 #1638 #1356 #1565 #1448 #1495 |
Thanks @aldas, this worked. Moving forward it sounds like the recommended approach if using a POST is to put these fields in the body rather than as query parameters, is that correct? |
Issue Description
Unable to bind query parameters after update.
URL and query parameters:
POST
10.42.0.1:1232/api/v1/Settings/WirelessNetwork?ssid=TEST&password=pass123
Expected behaviour
After
c.Bind(req)
I'd expect req to hold the query parameters like it previously worked.Actual behaviour
All fields in
req
are empty.Working code to debug
Prints:
Version/commit
This broke after I updated from v4.1.17 -> v4.4.0
The fields used to be tagged
json:"ssid"
but looking through the docs this looks to have changed. I'm assuming I'm still missing something. Would hate to revert to the old release if I can't get this working.The text was updated successfully, but these errors were encountered: