nodejs request.body returns empty object {}
<p>I am using following code, request.body returns <code>{}</code> i would expect my output as <code>{username:"Mani",password:"pass"}</code> please help me to fix if anything wrong in this code sample.</p>

<h2>app.js</h2>

<pre><code>var bodyParser = require('body-parser');
var express = require('express');
var app = express();

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

app.post('/', function(request, response){
  console.log(request.body);      // your JSON
  response.send(request.body);    // echo the result back
});

app.listen(3000, function () {
  console.log('Example app listening on port 3000!');
});
</code></pre>

<p>npm version:</p>

<p>express 4.14.0</p>

<p>body-parser 1.15.2</p>

<p>url <a href="http://localhost:3000/" rel="nofollow">http://localhost:3000/</a></p>

<p>method: POST</p>

<p>header: Content-Type: application/json</p>

<p>request payload : {username:"Mani",password:"pass"}</p>

<p>output of app.js console is {}</p>