2015-07-21 38 views

回答

0

的問題是,服務器返回的響應壓縮格式(gzip的),即使你沒有明確通過請求頭自討苦吃。

要解決,你可以使用gzip選項request

request({ 
    url  : url, 
    gzip : true, 
    timeout : 2000 
}, function(error, response, html){ 
    console.log(html); 
});