var http = require('http')
var $ = require('jquery')
var url = require('url')
var BufferHelper = require('bufferhelper');
var options = {
hostname:'ask.39.net',
path:'/',
method:'GET',
headers:{
'Accept':'*/*',
'Connection':'close',
'User-Agent':'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.31 (KHTML, like Gecko) Chrome/26.0.1410.64 Safari/537.31'
}
}
var bufferHelper = new BufferHelper();
var req = http.request(options,function(res){
res.on('data', function (chunk) {
bufferHelper.concat(chunk)
});
})
req.end()
console.log(bufferHelper.toBuffer().toString())**strong text**
上面的data一直无法正常打印出来了。求修改代码