这段代码有错吗?为什么调用不了百度地图api
var request = require('request'); request('http://api.map.baidu.com/geocoder/v2/?callback=renderReverse&location=39.983424,116.322987&output=json&pois=1&ak=xxxxxx', function (error, response, body) { console.log('error:', error); // Print the error if one occurred console.log('statusCode:', response && response.statusCode); // Print the response status code if a response was received console.log('body:', body); // Print the HTML for the Google homepage. });
CMD 运行后结果:
D:\Nodejs\company>node app2.js error: { Error: connect ECONNREFUSED 103.235.47.88:80 at Object._errnoException (util.js:1041:11) at _exceptionWithHostPort (util.js:1064:20) at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1153:14) code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect', address: '103.235.47.88', port: 80 } statusCode: undefined body: undefined
D:\Nodejs\company>