2
我是nodejs和express的新手。我正在使用「請求」庫來閱讀google.com的內容。我不斷收到連接拒絕錯誤。我把代碼https://github.com/request/request節點請求返回ECONNREFUSED
這是我first_request.js文件:
var request = require('request');
request('http://www.google.com', 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.
});
要運行,我到該文件夾並做node first_request.js
它給我的錯誤是:
我在做什麼錯?任何指針?