-
-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
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
Error: unsupported BodyInit type when attempting to post data to endpoint accepting the "application/x-www-form-urlencoded" content-type #94
Comments
This is a very serious issue. This line breaks everything now: If you pass a JSON string it will be spread into letters. If you pas a FormData object it will be spread as a simple JS object. Normally, you should pass a FormData object as a body and the the fetch implementation should handle it (e.g. whatwg-fetch). |
Thank you @elvinas-engagecraft and @Anitorious, will have this patched, tested, and released soon. |
I believe I'm running into a similar issue when attempting to post to a json:api endpoint, e.g.: api.post('/entity', {
headers: {
'content-type': 'application/vnd.api+json',
},
body: JSON.stringify(entityData),
}); Yields:
|
Submitted a PR. This probably exposes a hole in test coverage, as well? |
Released on npm as [email protected] 🎉 |
This is actually resolved as of v3.1.2, not v3.1.1. See 45f4614. |
After updating to the latest version of frisbee to make use of the new abort features, I've encountered errors with posting data in a url-encoded format. I'm downgrading for the time being as I have no issues with v2.0.6.
An example of the offending code is as follows:
The end point accepts this format, and this format alone. One thing to note is this error is being thrown before the request to the server has been sent.
Version: 3.0.2
Stack Trace:
The text was updated successfully, but these errors were encountered: