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
As HTTP.jl supports queryparams to decode parameters of a query string, I am surprised there's no facility to decode forms encoded in application/x-www-form-urlencoded. Especially as this is the default encoding for web forms.
Important to note is that the encoding is actually slightly different from query strings in URLs, so you can't just use queryparams as is on the body. The key difference is that a space character is encoded as a + in x-www-form-urlencoded while it is encoded as a %20 in URIs (https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding).
While one can easily write a homegrown function in their project to take care of it, this body encoding is so ubiquitous that I suggest HTTP.jl should offer a standard function to decode it, and also an example in the documentation. Not doing so can also be error-prone for people not familiar with web forms: looking around a bit, they might think they can just use queryparams on the body, not realizing this is incorrect.
If you're fine with that, I can prepare a PR to add this functionality as well as a nice example of using it :)
The text was updated successfully, but these errors were encountered:
Hi! Thanks a lot for this library!
As HTTP.jl supports
queryparams
to decode parameters of a query string, I am surprised there's no facility to decode forms encoded inapplication/x-www-form-urlencoded
. Especially as this is the default encoding for web forms.Important to note is that the encoding is actually slightly different from query strings in URLs, so you can't just use
queryparams
as is on the body. The key difference is that a space character is encoded as a+
inx-www-form-urlencoded
while it is encoded as a%20
in URIs (https://developer.mozilla.org/en-US/docs/Glossary/percent-encoding).While one can easily write a homegrown function in their project to take care of it, this body encoding is so ubiquitous that I suggest HTTP.jl should offer a standard function to decode it, and also an example in the documentation. Not doing so can also be error-prone for people not familiar with web forms: looking around a bit, they might think they can just use
queryparams
on the body, not realizing this is incorrect.If you're fine with that, I can prepare a PR to add this functionality as well as a nice example of using it :)
The text was updated successfully, but these errors were encountered: