Skip to content

HttpRequest

blackshadev edited this page Oct 2, 2015 · 3 revisions

Describes the incoming request from the user.

Properties

Name Description
headers Headers send to the user as an plain object. eg. { "content-type": "text/html" }
queryParams Dictionary of query parameters given in url
parameters The parameters given in the url via the routing system, stored as a plain object.
uri The left over URI resulted from a wildcard route
routePath The route taken with the url
_isLoaded Boolean to indicate the body data is already loaded in _data property
_events Internal EventEmitter, emits "loadend"
_req Reference to the NodeJs Incoming Message object

Methods

Name Description
body(callback, bin) Gets the body of the request and calls the callback with the request body as first parameter, when bin is truely the data won't be casted to a string
header(key) Returns the header with the given key as key in the headers object
parameter(key) Returns the parameter with the given key as key in the headers object
query(key) Gets a parameter out of the query string

Clone this wiki locally