Is there a built in way to get the headers of a specific address via node.js?
something like,
var headers = getUrlHeaders(\"http://stackoverflow.com\
Using the excellent request module:
var request = require('request');
request("http://stackoverflow.com", {method: 'HEAD'}, function (err, res, body){
console.log(res.headers);
});
You can change the method to GET if you wish, but using HEAD will save you from getting the entire response body if you only wish to look at the headers.