First of all I have tried this, this and this.
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({extended: false}))
app.post('/user_create', (req,res) => {
console.log("trying to create a user "+req.body);
const firstName = req.body.first_name
const lastName = req.body.last_name
console.log("first name is "+firstName+" "+lastName);
res.end()
})
Now after trying all the post given above, I am still getting req.body undefined, I am newbie in Nodejs. I am using express 4.16.4 and body-parser 1.18.3.