title: unable to get request.body in express
body: <p>I am playing with express and trying to understand the basic work of form submission and I am unable to get data on req.body(gives empty object).Here is the html and js file I am using.</p>
  
  <p><strong>HTML File</strong></p>
  
  <pre><code>         &lt;form class="form-horizontal" id="form" action="/action" method="post" role="form"&gt;
              &lt;h2&gt;Registration Form&lt;/h2&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="firstName" class="col-sm-3 control-label"&gt;Full Name&lt;/label&gt;
                  &lt;div class="col-sm-9"&gt;
                      &lt;input type="text" id="firstName" placeholder="Full Name" class="form-control" autofocus=""&gt;
                      &lt;span class="help-block"&gt;Last Name, First Name, eg.: Smith, Harry&lt;/span&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="form-group"&gt;
                  &lt;label for="email" class="col-sm-3 control-label"&gt;Email&lt;/label&gt;
                  &lt;div class="col-sm-9"&gt;
                      &lt;input type="email" id="email" placeholder="Email" class="form-control"&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/form&gt;
  </code></pre>
  
  <p>and </p>
  
  <p><strong>Javascript File</strong></p>
  
  <pre><code>var express = require('express');
  var bodyParser = require('body-parser');
  var app     = express();
  
  
  app.use(bodyParser.urlencoded({ extended: true })); 
  
  
  var MongoClient = require('mongodb').MongoClient; 
  var myCollection;
  
  app.post('/action', function (req, res) {
      console.log("----------------------",req.body);
      res.send("done");
  });
  
  app.get('/', function (req, res) {
    res.sendFile(__dirname+"/signup.html");
  });
  
   app.listen(3000, function () {
   console.log('Example app listening on port 3000!');
   var db = MongoClient.connect('mongodb://127.0.0.1:27017/test',         
     function(err, db) {
         if(err)
          throw err;
        else{
          console.log("connected to the mongoDB !");
          myCollection = db.collection('test_collection');
        }
    });
  });
  </code></pre>