body parameters arrived empty to the server API
See original GitHub issueHi guys,
Great work, I have issue, when do uploading blob, as multipart request, the other fields in body arrived empty at server side when doing upload from IOS, on android it just work fine,
let cleanFilePath = feedItem.media.path.replace('file://', '');
const body = [
{
name: 'data',
data: JSON.stringify(feedItem),
type: 'application/json'
},
{
name: 'file',
filename: mediaFileName,
data: RNFetchBlob.wrap(cleanFilePath),
type: mediaFileType
}
];
RNFetchBlob.fetch('POST', request.url, {
'Content-Type': 'multipart/form-data',
Authorization: (auth) ? 'Bearer ' + auth.accessToken : ''
},
body).uploadProgress({ interval: 5000 }, (written, total) => {
console.log('uploaded', written / total)
dispatch({ type: 'FEED_ITEM_COMPOSER_CREATE_PROGRESS', payload: Math.round((written / total) * 100) + '' });
})
.then((res) => {...............
Any idea why data parameter, received empty by the server API for IOS only?
Edit: This happen only when calling https API, when changing the link to http, it worked.
Thanks
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:6
Top Results From Across the Web
Trying to send body parameters but req.body is empty
I got the solution to the problem I had mentioned, in this case, I needed to use params from the Get method.
Read more >Build a Hello World REST API with Lambda proxy integration
Learn how to build and test an API with Lambda proxy integration using the API ... Create an empty API as follows: ......
Read more >Add a Request Body to a POST Request | API Connector
A content-type header describes the object's format, so the server knows how to ... If you need to send an empty request body,...
Read more >Method: people.get | People API - Google Developers
Got it. On this page; HTTP request; Path parameters; Query parameters; Request body; Response body; Authorization Scopes; Try it.
Read more >API return empty body - Confluence Data Center
Hi All, I am using Confluence REST API, is it possible to get the content from the wiki? I can access it but...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
change
'Content-Type': 'multipart/form-data',
to'Content-Type': 'application/json',
and you body var need to look like this:
POST method did the trick for me.