react-native-fetch-blob
react-native-fetch-blob copied to clipboard
curl -F equivalent with RNFetchBlob
I am having some issues translating ‘-F’ in curl to something in react-native-fetch-blob when doing an upload. The API does not call for additional headers as shown in the example but rather a file and information about that file. Is there a way to translate this curl command into something that RNFetchBlob can process?
Curl Command:
curl -X POST https://something./api/uploadFile/
-F file[][email protected] \
-F name[]=tester \
RNFetchBlob Command:
RNFetchBlob.fetch('POST',https://something./api/uploadFile/, {
Authorization : 'Basic 1234567NO',
'Content-Type' : 'application/octet-stream'
},imageData).then((resp) => {
}).catch((err) => {}
React-Native version: 0.50.3 RNFetchBlob version:0.10.8
I can't figure this out either. I'm trying upload picture to strapi from ios. Used a bunch of ways but none of them worked. However with curl works.