0
服务器发送503错误,但res.on('error')函数不打印它。https对错误功能没有捕获503错误
https.get(url, function(res){
var body = '';
res.on('data', function(chunk){
body += chunk;
});
res.on('error', function(err) {
console.log(err);
});
res.on('end', function(){
var response = JSON.parse(body);
console.log(response.stream);
});
});