question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Complications with POST request

See original GitHub issue

Hello,

My colleagues and I are trying to upload videos with react-native-background-upload, but although we can see the progression of the file being uploaded, our API receives a request without the video file or any body.

Does your library supports sending requests with body? Is there a way to send a request with the videos on body instead of using path? Which key can we use to retrieve the video file on our API, if we’re adding the video file via ‘path’.

We are using react-native version 0.44.0 and testing on an iPhone device

Our options:

const uploadOptions = {
    url: REQUEST_URL,
    path: video.uri, 
    method: 'POST',
    headers: {
        ‘key’: ‘value’,
    },
    body: formData,
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:16 (5 by maintainers)

github_iconTop GitHub Comments

3reactions
rad182commented, Oct 26, 2017

@StevePotter thanks for the quick response. Sorry but I don’t see any parameters where I can pass multiple/extra form fields/data or body? For what I understand

field: 'uploaded_media'

this field is the name of the file right?

3reactions
valinagacommented, Jun 13, 2017

same issue reported here. https://github.com/Vydia/react-native-background-upload/issues/32 affect both ios and android.

Read more comments on GitHub >

github_iconTop Results From Across the Web

POST - HTTP - MDN Web Docs
The HTTP POST method sends data to the server. The type of the body of the request is indicated by the Content-Type header....
Read more >
POST Request problems in JavaScript - jquery - Stack Overflow
I`m working on a project in JavaScript and basically what I want is to send a post request to my server in order...
Read more >
Why can't we use POST method for all requests? [closed]
It is known that sensitive information should not be transmitted in GET requests as GET requests will be cached and POST should be...
Read more >
Http POST request problems (SOLVED) - Defold Forum
Trying to hook up Defold with the POEditor ( a nifty localization tool). Sending a normal Curl request with the same arguments it...
Read more >
GET vs POST - Difference and Comparison | Diffen
GET requests are re-executed but may not be re-submitted to server if the HTML is stored in the browser cache. The browser usually...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found