I'm going to test via curl a simple application with Nodejs.
curl command is:
curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "Name"}' http://localhost:3000/users
and Node.js runs like:
app.post('/users', users.addUser);
and somewhere else in users:
exports.addUser = function(req, res) {
console.log(req.query);
//etc.
output is {}
. req.body, instead, is undefined.
How can I retrieve that parameters with curl? Am I missing something?