title: Nodejs/Express req.body is Undefined
body: <p>I have an issue with a post request that suddenly broke and I can't seem to find the issue. In the post form the console.log returns UserID correctly, but within the function the console.log returns Undefined.</p>
  
  <p>Post form:</p>
  
  <pre><code>app.post("/loadTransactions", function(req, res, Data) {
    console.log(req.body.UserID)
    transactions.loadTransactions(req.body.UserID, function(label) {
      Data = label;
      res.send({message: Data});
      })   
    })
  </code></pre>
  
  <p>Function:</p>
  
  <pre><code>loadTransactions({ UserID }, callback){
          console.log({UserID})
          var sql = `SELECT * FROM MyTable WHERE UserID = ${UserID}`
          var label
          database.Query(sql, function(result){
              label = result[0];
              callback(label)
              });
      }
  </code></pre>
  
  <p>Client side:</p>
  
  <pre><code>window.onload=function(){
  const CreateUser = document.querySelector('.Load');
  CreateUser.addEventListener('submit', (e) =&gt;{
      e.preventDefault()
      const UserID = Load.querySelector('.UserID').value
      post('http://1.3.3.7/loadTransactions', {UserID})
  })
  
  function post (path, data){
      console.log(data)
      return window.fetch(path,{
          method: 'POST',
          headers: {
              'Accept' : 'application/json',
              'Content-Type': 'application/json'
  
          },
          body: JSON.stringify(data)
      })
  }
  
  }
  </code></pre>