Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 491 Bytes

gzip-encoding-response.md

File metadata and controls

21 lines (16 loc) · 491 Bytes

How to decode a GZip response with Node.js

The easiest way to decode a GZip response with Node.js is to use a deprecated request npm module:

var request = require('request');

const options = {
    method: 'GET',
    uri: 'https://google.com',
    gzip: true
};

request(options, function (error, response, body) {
    // body is the decompressed response body
    console.log('response body: ' + body);
});

References: