Wrong Content-Type on uploading file using axios in react-native #21814
Labels
Bug
Platform: iOS
iOS applications.
Platform: Linux
Building on Linux.
Resolution: Locked
This issue was locked by the bot.
Type: Invalid
This issue does not belong here. Applying this label will cause issue to be closed.
Environment
React Native Environment Info:
System:
OS: Linux 4.15 Ubuntu 16.04.4 LTS (Xenial Xerus)
CPU: x64 Intel(R) Core(TM) i5-6200U CPU @ 2.30GHz
Memory: 520.49 MB / 11.64 GB
Shell: 4.3.48 - /bin/bash
Binaries:
Node: 10.11.0 - ~/.nvm/versions/node/v10.11.0/bin/node
Yarn: 1.10.1 - ~/.nvm/versions/node/v10.11.0/bin/yarn
npm: 6.4.1 - ~/.nvm/versions/node/v10.11.0/bin/npm
SDKs:
Android SDK:
Build Tools: 23.0.1, 25.0.0, 25.0.2, 26.0.1, 26.0.2, 26.0.3, 27.0.3
API Levels: 23, 25, 26, 27
npmPackages:
react: 16.6.0-alpha.8af6728 => 16.6.0-alpha.8af6728
react-native: 0.57.3 => 0.57.3
npmGlobalPackages:
react-native-cli: 2.0.1
Description
I tried to upload a file using axios in react-native using the following sample code
On react-native it is setting the content-type as "text/plain" but when I tried on the web it is setting the correct content-type as "multipart/form-data".
I tried setting Content-Type : 'multipart/form-data' but still it reverts back to text/plain in react-native.
The text was updated successfully, but these errors were encountered: