How to use request or http module to read gzip page into a string

前端 未结 5 1328
被撕碎了的回忆
被撕碎了的回忆 2020-12-09 05:09

I found the request module in js cannot handle gzip or inflate format http response correctly.

for example:

request({url:\'some url\'}, function (err         


        
5条回答
  •  难免孤独
    2020-12-09 05:50

    request module handles the gzip responses. All we have to do is to set 'gzip' attribute in the opts. For detailed explaination please visit the below linke. There I have clearly explained with example.

    https://stackoverflow.com/a/38582506/5878471

提交回复
热议问题