RequestBuilder::query and RequestBuilder::form both use application/x-www-form-urlencoded
Both of these methods can be used to add parameters to the query string of the URL used in a GET request. They both encode the parameter using the application/x-www-form-urlencoded scheme.
However, I think one of these two statements is true:
- The
querymethod should not use theapplication/x-www-form-urlencodedscheme because it is only meant for forms. The URL percent-encoding should be used to encode spaces.- The WHATWG URL spec has this to say:
The application/x-www-form-urlencoded format is in many ways an aberrant monstrosity, the result of many years of implementation accidents and compromises leading to a set of requirements necessary for interoperability, but in no way representing good design practices. In particular, readers are cautioned to pay close attention to the twisted details involving repeated (and in some cases nested) conversions between character encodings and byte sequences. Unfortunately the format is in widespread use due to the prevalence of HTML forms. [HTML]
- If the
querymethod continues to use theapplication/x-www-form-urlencodedscheme then it should also clarify it's intent for the server by setting thecontent-typeheader.- However, then it essentially becomes the
formmethod. So I suspect the prior point carries more weight.
- However, then it essentially becomes the