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\
Try to look at http.get and response headers.
var http = require("http");
var options = {
host: 'stackoverflow.com',
port: 80,
path: '/'
};
http.get(options, function(res) {
console.log("Got response: " + res.statusCode);
for(var item in res.headers) {
console.log(item + ": " + res.headers[item]);
}
}).on('error', function(e) {
console.log("Got error: " + e.message);
});