我看到必须确保从机器上正确解析DNS,检查节点文档以确保域可解析.
我正在写一个基于节点的程序,用户可以让我代表他们做一个httprequest {当然他们为我提供了一些数据和调用的方法}但是每次我做一个httprequest它都会给我一个错误
getaddrinfo ENOENT这是我的代码看起来的样子
function makehttprequest(deviceid, httpaction, httppath,methods, actiondata, callback) {
console.log('we are here with httpaction' + httpaction + ' path ' + httppath + ' method ' + methods + ' action data ' + actiondata);
//do the http post work, get the data, and call the callback function with return data
var options = {
host: httpaction,
port: 80,
path: httppath,
method: methods
};
try {
var req = http.request(options, function(res) …Run Code Online (Sandbox Code Playgroud)