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
I don't think there's a way to achieve what you want and this is probably expected behaviour. Since [ and %5B are effectively the same thing when it comes to a query parameters there's no way for us to 'escape' the bracket so we need to treat a[b] as a dictionary with a key rather than the key itself. Dictionaries are a pain in URL queries so Vapor needs to make a decision somewhere and this is the line we've drawn unfortunately.
I'll close this but feel free to ask more questions or reopen if you think there's a better solution
If I send a request with the following query parameters:
?a[]=1&a[]=2
I get:
key: "a", value: ["1", "2"]
However, if I send
?a[b]=1&a[b]=2
I get
key: "a", value: []
Replacing
[
and]
with%5B
and%5D
makes no difference.Furthermore,
?a[b]c=1
results in an exception"Malformed form-urlencoded key encountered: a[b]c"
I personally would like to parse
?a[b]=1&a[b]=2&a[c]=3
intoHere is the test Content struct:
Thank you.
The text was updated successfully, but these errors were encountered: