title: Login to another site from nodejs server
body: <p>I am trying to login into a site to scrap the data. Login works fine if try to do it through <code>Chrome Rest Client</code> but from node server I am getting <code>status code 302</code> from the website.<br/><strong>Code</strong></p>
  
  <pre><code>var http = require('http'),
      express = require('express'),
      request = require('request');
  
  
  
  var app = express();
      app.listen(3000);
  
  var request = request.defaults({jar:true});
  app.post('/login', [express.urlencoded(), express.json()], function(req, res) {
      console.log('You are here'); console.log(JSON.stringify(req.body.email));
      request.post({
        url: 'http://teeSpring.com/login/submitLogin',
        form: {
          email: "himanshu",
          password: "himanshu"
        }
      }, function(error, resposne, body) {
        if (error) {
          console.log('Error is: '+JSON.stringify(error));  
        } else if(body){
          console.log('Body is :')//+JSON.stringify(body));
        } else if(resposne) {
          console.log('Response is :'+resposne.statusCode);//+JSON.stringify(resposne));
          res.send(resposne);
        } else {
          console.log('WTF');
        }
  
      });
  
  });
  </code></pre>