title: Unable to do post request on node.js server using express
body: <p>I have an index.js file which has code to handle get and post requests.</p>
  
  <p>GET request is working pretty fine, the problem is with POST. </p>
  
  <p>here is my code.</p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  /* GET home page. */
  router.get('/', function(req, res, next) {
      res.render('index', { title: 'Express' });
  });
  
  
  router.post('/', function(req, res, next) {
      console.log("post request to index");
      res.render('index', { title: 'Express' });
  });
  
  module.exports = router;
  </code></pre>
  
  <p>Using Rest client, if I ping my server with a method, i am getting 400 error.</p>
  
  <p>Please help.</p>
  
  <p>Nikhil</p>