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
Convert form-url encoded content-type to json & use qs parser (#185)
* Convert content-type to json & use qs parser
- `Utils.safeJSONParse` uses `JSON.parse` under the hood which
cannot convert form url encoded query strings (which is what the
string format of the binary data/Buffer string would be) to a
"JSON Object" so we'll use the core node.js module, `querystring`
to parse it. However, this parser might not automagically convert
the Buffer to a string, so we'll convert it first and then parse
it using the correct parser.
- For some reason, we need to have the `content-type` to use
`application/json`. This is no matter if the body is correctly
parsed or not. My guess is there is some method in `hydra` library
that requires the header content type to be json rather or the
body is parsed in a string format rather than a JSON format.
This change seems to be the cleanest with minimal changes to the surface
area without also updating any other libraries. Previously, we are
unable to send any requests with form url encoded body params whereas
now form url encoded body params will be converted to json body
params.
* Minor bump version from 1.6.20 -> 1.7.0
* Remove speculated comment
0 commit comments