154
rated 0 times
[
158]
[
4]
/ answers: 1 / hits: 64749
/ 10 Years ago, wed, september 24, 2014, 12:00:00
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.
app.get('/api/v1/urlCheck/', function (req,res) {
var url=req.query['url'];
var request = require('request');
request.get(url, {timeout: 30000, json:false}, function (error, result) {
res.send(result.body);
});
});
Appreciate any help!
More From » node.js