-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Network Error when send file with formData(axios or fetch) on Android. Works fine on IOS. #44657
Comments
|
This issue still in const formData = new FormData()
This returns network error REACT-NATIVE-INFO output:- System: |
Same issue here.. const fileExtension = coverImage.split(".").pop();
When I console.log req.file and req.body, undefined [Object: null prototype] { Here I'm not sending any data in req.body only sending file to req.file which I get undefined.. |
This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days. |
Same problem here yet |
@saadkhan2211 @felipeavila-vp @H3tansh Hi, could you provide Missing Reproducible Example as above, so I can help you solve this problem? |
@huzhanbo1996 below is my working code, It only works if I use deployed HTTPS API URL , but do not work if I use HTTP endpoint running on my localhost.
P.S:- Issue only persist in android. here is the issue I've created |
Same here, but with windows.
|
Hi Everyone, Mine got fixed after some troubleshooting...All I did was that I removed Content-Type part from headers and It worked |
I had the same problem after upgrade React Native to 0.72.17. And in my case renamed from Content-Type => content-Type fixed the error. |
same issue, |
Description
When I try to send some post request sending a file with formData I receive a Network Error. Most of the time the request works fine, but sometimes I receive this error. The problem occurs when use Android, works fine with IOS.
Recently I updated my application to react-native 0.74.1(latest), before the version was 0.64.4. In older version all works fine.
Current versions:
Steps to reproduce
Only try to submit some files using formData
React Native Version
0.74.1
Affected Platforms
Runtime - Android
Output of
npx react-native info
Stacktrace or Logs
Reproducer
https://github.com
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: