title: Req.body is empty, express
body: <p>I am trying to make some client-server program using express. But no matter what I try req.body is always empty. I have searched for solutions, but the main problem in most cases is that 'Content-Type' or app.use(bodyParser.json()); are missing. I have got both, but it still doesn't work. </p>
  
  <p>Here is my server side:</p>
  
  <pre><code>const express = require('express');
  const app = express();
  const port = 5000;
  
  const bodyParser = require('body-parser');
  
  app.use(bodyParser.json());
  
  app.post('/', (req, res) =&gt; {
      console.log(req.body);
      res.send(req.body);
  });
  
  app.listen(port, () =&gt; console.log(`Example app listening on port ${port}!`));
  </code></pre>
  
  <p>Here is client side:</p>
  
  <pre><code>const promise = fetch('http://127.0.0.1:5000', {
      mode: 'no-cors',
      credentials: 'include',
      headers: {
          'Content-Type': 'application/json; charset=UTF-8',
          'Accept' : 'text/plain;charset=UTF-8',
      },
      method: 'POST',
      body: JSON.stringify({x: 2, y:3}),
  });
  </code></pre>