Consider using RFC3986 encode form-urlencoded
3.0.2 spec section Support for x-www-form-urlencoded Request Bodies:
To submit content using form url encoding via RFC1866, ...
And, RFC1866 section 8.2.1 The form-urlencoded Media Type:
The form field names and values are escaped: space characters are replaced by `+', and then reserved characters are escaped as per [URL]
Indicates that using encoding specified in RFC1738 and a special treatment on space character
While according to HTML 5.2 section 4.10.21.6 URL-encoded form data:
See the WHATWG URL specification for details on application/x-www-form-urlencoded. [URL] ...
Which says:
Note: URLs can be used in numerous different manners, in many differing contexts. For the purpose of producing strict URLs one may wish to consider [RFC3986] [RFC3987] ...
So, please consider using RFC3986 instead of RFC1738, RFC1738 is too old(December 1994).
I believe the only difference is that /, ?, and ';' are no longer reserved within the query string in RFC 3986, correct? (And I agree, it should reference RFC 3986).
I believe the only difference is that
/,?, and ';' are no longer reserved within the query string in RFC 3986, correct? (And I agree, it should reference RFC 3986).
Yes
Does anyone have a reference to the BNF/grammar for the "key=value" pairs? I wrote this:
query-params = query-param *( "&" query-param )
query-param = key [ "=" value ]
key = *qpchar
value = *( qpchar / "=" )
but is there an official IETF document (or addendum) that states this?
@vinniefalco there is no IETF document. There was a draft, but it was abandoned. WHATWG addresses it in their URL "living standard", although I assume like all of their specs it's defined in terms of browser implementation state machines as opposed to ABNF or anything like that.
Thanks! (I find the WHATWG "spec" exceptionally frustrating)
It's not clear to me whether we can change an RFC reference in a patch release, so for now I'm putting this in 3.2.