How do I check to see if a URL exists without pulling it down? I use the following code, but it downloads the whole file. I just need to check that it exists.
ap
Try this:
var http = require('http'), options = {method: 'HEAD', host: 'stackoverflow.com', port: 80, path: '/'}, req = http.request(options, function(r) { console.log(JSON.stringify(r.headers)); }); req.end();