Module stick/middleware/params
This module provides middleware for parsing HTTP parameters from the query string and request body.
It does not parse multipart MIME data such as file uploads which are handled by the upload module.
middleware (next, app)
Middleware for parsing HTTP parameters. This module handles URL-endcoded form data transmitted in the query string and request body as well as JSON encoded data in the request body.
Parameters
Function | next | the wrapped middleware chain |
Object | app | the Stick Application object |
Returns
Function | a JSGI middleware function |
request.params
An object containing the parsed HTTP parameters sent with this request.
request.postParams
An object containing the parsed HTTP POST parameters sent with this request.
If the content type of the request is application/json
, the middleware
parses the body and stores the in request.postParams
.
request.queryParams
An object containing the parsed HTTP query string parameters sent with this request.