-
-
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
|
If you need advice on contributing to useFetch, here's some commands to help.
In terminal window 1 git clone [email protected]:YOUR_USERNAME/use-http.git
cd ./use-http
yarn
yarn link In terminal window 2 (your react app to test create-react-app use-http-sandbox
cd ./use-http-sandbox
yarn
yarn link use-http In terminal window 1 (inside your forked npm link ../use-http-sandbox/node_modules/react
npm link ../use-http-sandbox/node_modules/react-dom
yarn build:watch In terminal window 2 (your react app to test yarn start
remote: Create a pull request for 'master' on GitHub by visiting:
remote: https://github.com/YOUR_USERNAME/use-http/pull/new/master go to that url. From there you should be able to compare your forked master branch to For your second issue, that's okay. Just add it to the todos in the readme and I'll get to it. I need to set that up anyway. |
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: