Empty POST body
See original GitHub issueHello i’m using Fetch on Node with React and Browserify, i trigger this code from a form submit:
event.preventDefault();
var form = new FormData();
form.append('a', 1);
fetch('http://localhost:8080/login', {
method: 'POST',
body: form
})
Can’t figure out why the request sent to the server has empty body, no matter what i put in (i also tried strings as body).
Any ideas?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:17
- Comments:17 (3 by maintainers)
Top Results From Across the Web
Is it considered bad practice to perform HTTP POST without ...
Yes, it's OK to send a POST request without a body and instead use query string parameters. But be careful if your parameters...
Read more >req.body is empty in POST requests : r/node - Reddit
Hi! I know this is basically a noob question but please bear with me. I noticed that POST requests on my node server...
Read more >JSON POST request using app sends empty body · Issue #8455
1 Go to New Tab · 2 Set up POST call · 3 Click on Body · 4 Set type to Raw and...
Read more >How to handle if JSON POST body is empty? - webMethods
Tell the client to send an empty JSON string, i.e. {} in the HTTP body when using Content-Type=application/json) · Tell the client to...
Read more >Handling REST POST method with Empty body on MPGW in ...
While arguably an empty body in a POST is a valid REST concept, DataPower will reject an empty body if you have the...
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 Free
Top 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
Thanks guys, saved me a day. Essentially, what did work out for me: Client: fetching with
headers: { "Content-Type": "application/json" }
Server: addingapp.use(require("body-parser").json())
I had the same problem. I solved using: