var http = require('http');
var options = {
method: 'GET',
host: 'www.google.com',
port: 80,
path: '/index.html'
};
http.request(
options,
function(err, resBody){
console.log("hey");
console.log(resBody);
if (err) {
console.log("YOYO");
return;
}
}
);
何らかの理由で、これはタイムアウトになり、コンソールに何も記録されません。
できることは承知していますが、使用しているプラグインと互換性を保つrequire('request')
ために使用する必要があります。http
また、私のバージョンの背景: Node is v0.8.2