How do I check to see if a URL exists without pulling it down?(如何检查URL是否存在而没有将其拉下?)
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!(感谢任何帮助!)
ask by metalaureate translate from so