Skip to content

Support decoding of application/x-www-form-urlencoded forms #1118

@nguiard

Description

@nguiard

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 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 :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions