var http=require('http');
var options = {
host:'localhost',
port:80,
path:'/read.txt'
};
http.get(options, function(res) {
console.log("Got response: " + res.statusCode);
res.on('data', function(data) {
console.log("Got data: " + data);
});
}).on('error', function(e) {
console.log("Got error: " + e.message);
});
node http.get options
最新推荐文章于 2023-11-28 14:18:15 发布