Wednesday 14 June 2017

https request is not working and I don't know why

I can access http://ift.tt/2t1Hhbd in the browser. When I run the following code I get no response. If I switch the url to google it works fine.const https = require('https'); https.get("http://ift.tt/2t1Hhbd", (res) => { console.log('statusCode:', res.statusCode); console.log('headers:', res.headers); res.on('data', (d) => { process.stdout.write(d); }); }).on('error', (e) => { console.error(e); }); { Error: read ETIMEDOUT at exports._errnoException (util.js:1018:11) at TLSWrap.onread (net.js:568:26) code: 'ETIMEDOUT', errno: 'ETIMEDOUT', syscall: 'read' }

Submitted June 14, 2017 at 03:55PM by cowardly_lying

No comments:

Post a Comment