O'Reilly logo
  • Patrick S thinks this is interesting:

app.post('/body', function(req, res){
  console.log(req.body);
  res.end(JSON.stringify(req.body)+'\r\n');
});

Again, submit a couple of HTTP POST requests with CURL or a similar tool:

$ curl http://localhost:3000/body -d 'name=azat'
$ curl -i http://localhost:3000/body -d 'name=azat&role=admin'
$ curl -i -H "Content-Type: applic...

From

Cover of Pro Express.js

Note

using bodyParser()