title: Empty body at server side when using fetch
body: <p>I am trying to send html form data to server via a fetch 'POST' request but at server side I am getting Empty request body. I have already tried different solutions provided on stack overflow but none of them is working at my end. could anyone please help me identify where I am going wrong.</p>
  <ol>
  <li><p>I have the form with id 'signup-form' in my html file</p>
  </li>
  <li><p>client side JavaScript the code  goes like below:</p>
  </li>
  </ol>
  <pre><code>const  myForm = document.getElementById('signup-form')
  
  myForm.addEventListener('submit', (e) =&gt; {
      e.preventDefault()
      const myForm = document.getElementById('signup-form')
      const data = new FormData(myForm)
      const option= {
          method: 'POST', 
          headers: {
              'Content-type': 'application/json'
          },
          body:JSON.stringify(data)
      }
      fetch('/login', option).then(
          response =&gt; response.json()
      ).then(
          data =&gt; console.log(data)
      ).catch(
          error =&gt; console.log(error)
      )
  })
  </code></pre>
  <ol start="3">
  <li>Server side express js code goes like below</li>
  </ol>
  <pre><code>app.use(express.urlencoded({ extended: false}))
  app.use(express.json())
  
  app.post('/login', (req, res) =&gt; {
      console.log('url is', req.url)
      const info = req.body;
      console.log('info is:', info)
      res.status(201).json({ 'submitted': true })
  })
  
  app.listen(3000, () =&gt; {
      console.log('listening on port 3000')
  })
  </code></pre>