title: The 'req.body' on Express.js v^4.17.1 returns 'undefined' from post requests
body: <p>I've been trying to get something to send to my shoutbox_endpoint, but on the Express.JS Backend where the endpoint is it returns <code>req.body</code> as <code>undefined</code></p>
  <h2>Post Request</h2>
  <pre class="lang-js prettyprint-override"><code>const headers = {
      &quot;SMN-Auth-JWT&quot;: &quot; REDACTED &quot;
  };
  
  axios.post(this.endpoint_shoutbox, {
      headers: headers,
      data: {
          user: who,
          message: message,
      }
  }).then(function (response) {
      console.log(response);
  }).catch(function (error) {
      console.log(error);
  });
  </code></pre>
  <h2>Backend Endpoint</h2>
  <pre class="lang-js prettyprint-override"><code>router.post('/shoutbox-relay', async (req, res) =&gt; {
      console.log(req.params); // {} 
      console.log(req.query); // {}
      console.log(req.body); // Undefined   
  });
  </code></pre>
  <h2>Main.js</h2>
  <pre class="lang-js prettyprint-override"><code>const Logger = require(&quot;./LogHandler&quot;);
  const config = require(&quot;../Settings/conf.json&quot;);
  const Path = require(&quot;path&quot;);
  const ExpressJS = require(&quot;express&quot;);
  const Router = require(&quot;./RouterHandler&quot;);
  const bodyParser = require('body-parser');
  const app = ExpressJS();
  
  module.exports.start = async (client) =&gt; {
      try {
          app.set(&quot;view engine&quot;, &quot;ejs&quot;);
          app.use(&quot;/assets&quot;, ExpressJS.static(Path.join(__dirname, &quot;../Website/assets&quot;)));
          app.use(&quot;/socket.io&quot;, ExpressJS.static(Path.join(__dirname, &quot;../Website/assets/socket.io&quot;)));
          app.set(&quot;views&quot;, Path.join(__dirname, &quot;../Website/views&quot;));
  
          app.use(bodyParser.json());
          app.use(bodyParser.urlencoded({ extended: true }));
          app.disable(&quot;x-powered-by&quot;);
      
          app.use(function (req, res, next) {
              req.bot = client;
              next();
          });
          app.use(&quot;/&quot;, Router.index);
          app.use(&quot;/about&quot;, Router.about);
          app.use(&quot;/chat&quot;, Router.chat);
          app.use(function (req, res, next) {
              var err = new Error(&quot;File Not Found&quot;);
              err.status = 404;
              next();
          });
  
          const Listener = http.listen(config.Website.port, function () {
              Logger.log(&quot;Website Handler&quot;, &quot;Webserver Started.&quot;);
          });
      } catch (err) {
          Logger.error(&quot;Website Handler&quot;, `Webserver failed to load due to: ${err}`);
      }
  };
  </code></pre>