We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using URLSearchParams() as body doesn't set content-type to application/x-www-form-urlencoded. https://fetch.spec.whatwg.org section 5.2
application/x-www-form-urlencoded
const body = new URLSearchParams({ grant_type: 'client_credentials' }) fetch(url, { method: 'POST', headers: { 'accept': 'application/json', }, body: body})
A workaround is to pass it explicitly. node-fetch package works as expected.
node-fetch
'content-type': 'application/x-www-form-urlencoded; charset=utf-8'
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Using URLSearchParams() as body doesn't set content-type to
application/x-www-form-urlencoded
. https://fetch.spec.whatwg.org section 5.2A workaround is to pass it explicitly.
node-fetch
package works as expected.The text was updated successfully, but these errors were encountered: