0
var https = require('https');
var options = {
hostname: 'https://172.16.2.51',
port: 9090,
path: '/vm/list',
method: 'GET',
};
var req = https.request(options, function(res) {
res.on('data', function(d) {
process.stdout.write(d);
});
});
req.end();
req.on('error', function(e) {
console.error(e);
});
寫一個劇本的Node.js當我運行該腳本,我得到這個錯誤:
{ [Error: getaddrinfo ENOENT] code: 'ENOTFOUND', errno: 'ENOTFOUND', syscall: 'getaddrinfo' }