title: Axios post sending body but body is undefined with fetch and Postman
body: <p>I'm not able to send a post body with fetch or Postman, but I can send the body with Axios.</p>
  <p>Axios returns: <code>User name = Fred, password is Flintstone</code></p>
  <p>But Postman and fetch both return <code>User name = undefined, password is undefined</code></p>
  <p>How can I get the post body with fetch and postman?</p>
  <h2>Server File</h2>
  <pre class="lang-js prettyprint-override"><code>const express = require(&quot;express&quot;);
  const bodyParser = require(&quot;body-parser&quot;);
  const app = express();
  const axios = require(&quot;axios&quot;);
  
  app.use(bodyParser.urlencoded({ extended: false }));
  app.use(bodyParser.json());
  
  app.post(&quot;/login&quot;, (req, res) =&gt; {
    var user_name = req.body.user;
    var password = req.body.password;
    console.log(&quot;User name = &quot; + user_name + &quot;, password is &quot; + password);
    res.end(&quot;yes&quot;);
  });
  
  app.listen(3000, () =&gt; {
    console.log(&quot;Started on PORT 3000&quot;);
  });
  </code></pre>
  <h2>Axios</h2>
  <pre class="lang-js prettyprint-override"><code>axios.post(&quot;http://localhost:3000/login&quot;, {
    user: &quot;Fred&quot;,
    password: &quot;Flintstone&quot;,
  });
  </code></pre>
  <h2>Fetch (client side)</h2>
  <pre class="lang-js prettyprint-override"><code>fetch(&quot;http://localhost:3000/login&quot;, {
    method: &quot;POST&quot;,
    body: JSON.stringify({ user: &quot;Fred&quot;, password: &quot;Flintstone&quot; }),
    mode: &quot;no-cors&quot;,
  });
  </code></pre>
  <h2>Postman</h2>
  <p><a href="https://i.stack.imgur.com/Q9Upd.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Q9Upd.png" alt="enter image description here" /></a></p>