-
-
Notifications
You must be signed in to change notification settings - Fork 114
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
File Upload fails due to added Content-Type header #213
Comments
will take a look. |
As a workaround in the meantime, you can remove that header like const { ... } = useFetch(opts => {
delete opts.headers['Content-Type']
return opts
}) |
I'm trying to decide what is more useful to more use cases. Adding the I'm down to remove this, just want to make sure it's the best decision. |
This should now work as of |
This doesn't seem to work, at least in React Native. It seems that the isObject test evaluates to true when passed |
@sbichenko Are you able to work around this for now? I can fix this unless you want to submit a PR. |
I don't think I can work around this. The workaround from your reply at the top doesn't work for me (haven't figured out why yet). I have a branch ready with a simple fix that I've tested manually, but
|
Thanks, that's great! I think it would be worth adding the instructions to the contributor guidelines. Here's the PR: #249 |
@sbichenko added a contributions.md |
Describe the bug
File Upload fails due to
Content-Type
header being automatically added when multipart/form-data is expectedFix: Remove the default content-type for POST and PUT that is added here https://github.com/alex-cory/use-http/blob/master/src/doFetchArgs.ts#L60
see here for more information: JakeChampion/fetch#505 (comment)
The text was updated successfully, but these errors were encountered: