title: Express 4.17 req body is empty
body: <p>The <code>req.body</code> always is empty.</p>
  <p>index.js:</p>
  <pre><code>const express = require('express');
  const app = express();
  const port = 8080;
  
  app.use(express.static('public'))
  app.use(express.json());
  app.use(express.urlencoded({ extended: true }));
  
  const userRoutes = require('./routes/user.routes');
  app.use(&quot;/user&quot;, userRoutes);
  
  app.listen(port, () =&gt; console.log(&quot;app listening.&quot;));
  </code></pre>
  <p>routes/user.routes:</p>
  <pre><code>const express = require('express');
  const router = express.Router();
  
  router.post('/', (req, res) =&gt; {
      res.json({ requestBody: req.body });
  });
  
  module.exports = router;
  </code></pre>
  <p>client script:</p>
  <pre><code>fetch('/user', {
          method: 'POST',
          body: JSON.stringify({ testData: &quot;testData&quot; }),
          headers: {
              'Accept': 'application/json',
              'Content-Type': 'application/json'
          },
      })
      .then(function(response) {
          return response.json();
      })
      .then(function(responseData) {
          console.log(responseData);
      })
      .then(function(result) {
          if (result.error) {
              alert(result.error.message);
          }
      });
  </code></pre>
  <p>Result of fetch in console:</p>
  <pre><code>{requestBody: {}}
  </code></pre>