Hi all,
when i use http method to connect and get content data of any
webpages , there is an error appears : getaddrinfo ENOENT error
my code :
var qs = require('querystring');
var http = require('http');
var server = http.createServer(function(req, res){
res.writeHead(200, {'content-Type': 'text/plain'});
var options ={
host: 'www.nodejs.org',
port: 80,
path: '/' + '?' +qs.stringify({q: 'hello word'})
};
var req = http.get(options, function(response){
var res_data = ' ';
response.on('data', function(chunk){
res_data += chunk;
});
response.on('end', function(){
console.log(res_data);
});
res.end(res_data);
});
req.on('err', function(e){
console.log("Got error : " + e.message);
});
});
server.listen(7005);
**error:
events.js:48
throw arguments[1]; // Unhandled 'error' event
^
Error: getaddrinfo ENOENT
at errnoException (dns.js:31:11)
at Object.onanswer [as oncomplete] (dns.js:140:16)
some body help me to fix it !
thank a lot !
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en