nae 上使用这个代码,发现有问题,页面直接挂了
exports.getTitleFrom = function getTitleFrom(reqqq,response){ var title; var req = http.request('http://www.baidu.com', function(res){ res.on('data', function (chunk) { title+=chunk.toString(); response.send(title); }); }); req.on('error', function(e) { console.log('problem with request: ' + e.message); }); req.end(); }