You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
URLParams gives a map[string]string, FormValues gives a string slice as you correctly pointed out, we can't change how these two are working( we don't want to introduce such a breaking change) but we can document the changes of these two better if you think that will help users, although I recommend use of FormValues for values that will going to be saved somewhere or used for authentication and etc. and use of URLParams to get things like ?referer= or ?id= which should be only one value per key. Tell me what are you thinking and we can make it happen.
Irrelevant, but, did you check my response on #1165 (comment) ?
You know why I didn't document these basics things? because net/http works the same way for form values and url params too, so I am thinking if we have to document so basic things we have to document more things too... hmm
In most cases, they are equivalent. But for some API contains params array, for example:
https://api.example.com/books?id=123&id=3435
pick
id
fromcontext::FormValues
, we get[]string{"123", "3435"}
,pick
id
fromcontext::URLParams
, we get"123,3435"
Should we always use
context::FormValues
to get params instead of usingcontext::URLParams
for all cases?The text was updated successfully, but these errors were encountered: