gzip Body Parser
Adds zlib as parser to the body-parser library, so you can convert incoming gziped data into a string representation.
This is really useful if you want to read gziped requests to save size
Installation
npm install --save express body-parser body-parser-zlib
Usage
This library adds an zlib
method to the body-parser
object.
Initialise like so:
var bodyParser = ;bodyParser;
Once initialised, you can use it just like any other body-parser
middleware:
var app = ;app;
This will parse any gziped request and place it as a JavaScript object on req.body
for your route handlers to use.
Example
var express =bodyParser = ;bodyParser;var app = ;app;app;
For Single routes
var express =bodyParser = ;var zlibParser;var app = ;bodyParser;var zlibParser = bodyParser;app;
Motivation
This library was born out of a frustration that body-parser, doesn't support parsing gziped content, if the header was not set, so for old systems you can use this
License
GPL 3