node.js - Not able call url from the function in nodeJS -
i trying call url localhost node js server
router.post("/registration", function (req, res) { var request = require('request'); request('http://www.google.com', function (error, response, body) { if (!error && response.statuscode == 200) { console.log(body) // print google web page. } else { console.log(error); } }) });
this url called inside function rest api
getting { [error: getaddrinfo enotfound] code: 'enotfound', errno: 'enotfound', syscall: 'getaddrinfo' } #1295
here if can read localhost, able read content or internet domain google.com or anyother domains not able
later came know that problem of local proxy settings
Comments
Post a Comment