Node.js missing body of POST request

I think need to add a little bit more configuration to node.js file, especifically you must add the body-parser dependency so you can extract the entire body portion from the incoming request.

You must install body-parser with npm: npm install body-parser --save

After that you should add it to your file and add configuration:

const bodyParser = require('body-parser')
const express = require('express');
const app = express();

app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended: false}))

More information on this post: https://stackoverflow.com/questions/38306569/what-does-body-parser-do-with-express#:~:text=body%2Dparser%20extract%20the%20entire,submitted%20using%20HTTP%20POST%20request.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top