API call with gzip encoding

Hello!

Ive asked ChatGPT to help me but it didnt give a viable solution

Ive done API calls before without any issues but this API service has gzip encoding
I have put an "Accept-encoding" into the http request.

However all im getting back as expected is garbage.
image

Has anybody done this before? any help appreciated as usual :slight_smile:

I guess you will need to unzip it to see the content ?

Take a look at node-red-contrib-gzip

1 Like

Thanks for the reply!

the gzip node only compresses not uncompresses ?

ChatGPT talked about gunzip but that node doesnt exist (that I can see anyway)

compress or decompress

Not quite true,

Passing a string, will compress said string, passing a buffer, will decompress said buffer.

So instead of returning a string from your request (assuming HTTP Request Node), get it to return a buffer, and pass that, the node will then treat it as a compressed buffer, and decompress it.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.