Reputation: 851
This is login form so unfortunately I don't have a working demo. I hope that I can explain fully what's happening.
I get this result from hurl.it:
and this is the entire header and body.
I try to simulate the same result using Node.js request
module:
var request = require ('request');
request
.get({
uri: "https://app.bom.com/j_login_user",
qs: {
"email": "email",
"password": "pass"
},
headers: {
"accept": "*/*",
"accept-encoding": "gzip, deflate",
"user-agent": "runscope/0.1",
"connection": "keep-alive"
}
})
.on('response', function(response) {
log.info(response);
});
However, the result is entirely different from the one hurl.it produce. Here is a pastebin of the response object, with response code 200 instead of 302: http://pastebin.com/rKEH0Uwr
Upvotes: 1
Views: 549
Reputation: 106696
request
by default handles redirects automatically, so you'll never see the 302 response code.
Upvotes: 1