title: Receiving POST request data using Superagent and Express 4
body: <p>Express -v : 4.13.3</p>
  
  <p>Superagent -v : 1.4</p>
  
  <p>function to send the POST request from the front-end of my app:</p>
  
  <pre><code>search: () =&gt; {
      request.post('/api/search')
        .set('Content-Type', 'application/json')
        .send({hello: 'hello w'})
        .end((err, response) =&gt; {
          if (err) return console.error(err);
  
          serveractions.receiveTest(response);
        });
    }
  </code></pre>
  
  <p>my express router file:</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  var bodyParser = require('body-parser');
  
  router.use(bodyParser.urlencoded({extended: false}));
  
  router.post('/api/search', (req, res, next) =&gt; {
    console.log(req.body);
    res.json({test: 'post received'});
  });
  
  module.exports = router;
  </code></pre>
  
  <p>The request is successfully being sent and received by the router, but req.body is always empty even though I am doing <code>.send({hello: 'hello w'})</code> with Superagent. What do I need to change in order to correctly send the json object and receive it in my router?</p>