I found the request module in js cannot handle gzip or inflate format http response correctly.
for example:
request({url:\'some url\'}, function (err
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