I'm trying to use request module to get HTTP status code. But sometimes it works wrong. For example:
var request = require('request');
var requestSettings = {
method: 'HEAD',
url: 'http://stackoverflow.com/help'
};
request(requestSettings, function(error, response, body) {
console.log(response.statusCode);
});
This code returns 404 (not 200 as expected).
Why might this happen?
Thanks.

curl http://stackoverflow.com/help -Ialso returns 404 whilecurl http://stackoverflow.com/help -ishows 200. Guess SO dosen't like HEAD requests.