Decompress Gzip JSON response

I'm getting GZIP type compressed response from web-service. Can anyone please help me how to decompress or decode the response.

Any help regarding this will be really helpful

Thanks

It looks as if you want to use Express and the express.compress middleware. That will figure out if a browser supports gzip and/or deflate, so you don't have to.

A simple setup could look like this:

var express = require('express');
var app     = express();

app.use(express.compress());
app.get('/', function(req, res) {
  res.send({ app_id: 'A3000990' });
});
app.listen(3000);

If your data is a JSON-string, you have to set the correct content-type header yourself:

res.setHeader('Content-Type', 'application/json');
res.send(data);