title: Request body is empty when making a POST request via HTML form
body: <p>I'm having a problem with symptoms similar to <a href="https://stackoverflow.com/questions/12039166/req-body-is-empty-when-making-a-post-request-via-http-request">this question</a> and several others, though the answers haven't helped me. I'm trying to submit a password via a simple HTML form to a Node app, but the request body keeps coming back empty.</p>
  
  <p>Server:</p>
  
  <pre><code>app.use(bodyParser.urlencoded({extended: true}));
  
  router.post('/login', (req, res) =&gt; {
    console.log(req.body);
    console.log(req.headers['content-type']);
  });
  </code></pre>
  
  <p>Form:</p>
  
  <pre><code>&lt;form action="/login" method="post"&gt;
    &lt;input type="password" id="password"&gt;
    &lt;button type="submit"&gt;Log In&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>If I submit the form, I get the following:</p>
  
  <pre><code>{} // req.body
  'application/x-www-form-urlencoded' // req.headers['content-type']
  </code></pre>
  
  <p>However, if I try to curl the endpoint, I get a non-empty <code>req.body</code>:</p>
  
  <pre><code>$ curl -X POST localhost:5000/login -d 'password=testpw'
  
  // Output
  { password: 'testpw' }
  'application/x-www-form-urlencoded'
  </code></pre>
  
  <p>What am I doing wrong?</p>