title: req.body empty on posts
body: <p>All of a sudden this has been happening to all my projects.</p>
  
  <p>Whenever I make a post in nodejs using express and body-parser <code>req.body</code> is an empty object.</p>
  
  <pre><code>var express    = require('express')
  var bodyParser = require('body-parser')
  
  var app = express()
  
  // parse application/x-www-form-urlencoded
  app.use(bodyParser.urlencoded())
  
  // parse application/json
  app.use(bodyParser.json())
  
  app.listen(2000);
  
  app.post("/", function (req, res) {
    console.log(req.body) // populated!
    res.send(200, req.body);
  });
  </code></pre>
  
  <p>Via ajax and postman it's always empty.</p>
  
  <p>However via curl</p>
  
  <pre><code>$ curl -H "Content-Type: application/json" -d '{"username":"xyz","password":"xyz"}' http://localhost:2000/
  </code></pre>
  
  <p>it works as intended.</p>
  
  <p>I tried manually setting <code>Content-type :  application/json</code> in the former but I then always get <code>400 bad request</code></p>
  
  <p>This has been driving me crazy.</p>
  
  <p>I thought it was that something updated in body-parser but I downgraded and it didn't help.</p>
  
  <p>Any help appreciated, thanks.</p>