title: how to get data from post request in express\nodeJS and redirect user to html file after submit
body: <p>i just red this <a href="http://www.hacksparrow.com/post-get-request-handling-in-node-js-express.html" rel="nofollow">post</a></p>
  
  <p>my express Code is</p>
  
  <pre><code>var express= require('express');
  var app= express();
  var path= require('path');
  app.use(express.static(path.join(__dirname,'public'))) //one way to server file
  //app.use(express.static(__dirname,'/public'));
  
  app.get('/',function(request, response){
      response.send("responde send");
  
  
  
  })
  app.get('/userName',function(request, response){
      response.send(request.query["userName"]);
  
  })
  app.post('/userName1',function(request,response){
      response.send(request.body.userName);
      console.log(request.body['userName']);
  
  })
  
  
  
  var server= app.listen(3001,function(){
      var host = server.address().address
      var port = server.address().port
  console.log("listening "+port+ "port while the host"+host);
  })
  </code></pre>
  
  <p>now handling get request using this code
  html is </p>
  
  <pre><code>&lt;form action="/userName" method="get"&gt;
      &lt;input type="text" name="userName"&gt;
      &lt;input type="submit"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>for post request my html is</p>
  
  <pre><code>&lt;form action="/userName1" method="post"&gt;
      &lt;input type="text" name="userName"&gt;
      &lt;input type="submit"&gt;
  
  &lt;/form&gt;
  </code></pre>
  
  <p>but the problem how to get post request data??
  i have tried these two line</p>
  
  <pre><code> response.send(request.body.userName);
   console.log(request.body['userName']);
  </code></pre>
  
  <p>but not working while this <a href="http://www.hacksparrow.com/post-get-request-handling-in-node-js-express.html" rel="nofollow">link code is same</a> where i am learning.
  Also inform me how to redirect user to any html file when user submit a form?</p>