Your script specifies 'Accept-Encoding': 'gzip, deflate',
so the response body is probably going to be Gzip or Deflate encoded as long as the server supports it.
Two options:
- You'll need to either disable that and just get the response without compression.
- Decompress the data by checking the
Content-Encoding
response header and then usingzlib.gunzip
orzlib.inflate
. Your current code doesn't use streaming, but if it did, you would usezlib.createGunzip()
orzlib.createInflate()