Get Body
General HTTP request body parser.
Looking for a multipart body parser? Try busboy
.
Installation
npm install get-body --save
Usage
createServer
Arguments
stream: Readable
An instance of the request streamheaders: object
The raw headers object as a lower-cased mapoptions: object
Parser configuration
Options
limit
Controls the maximum request body size (default:100kb
).decoders
Map of knowncontent-encoding
decoders (default:exports.decoders
)jsonParse
Custom behaviour for JSON parsing (default: strictJSON.parse
check)formParse
Custom behaviour for form parsing (default:querystring.parse
)jsonTypes
Array of media types to parse as JSONformTypes
Array of media types to parse as a formtextTypes
Array of media types to parse as text
TypeScript
This project is written using TypeScript and publishes the definitions directly to NPM.
License
Apache 2.0