Request Object Flashcards
req.params
An array containing the named route parameters
req.param(name)
Returns the named route parameter, or GET or POST paramaters
req.query
An object containing the querystring parameters (some times called GET parameters) as name/value pairs
req.body
An object containing the POST parameters. requires body parser middleware
req.route
Information about the currently matched route. useful for route debugging
req.cookies
Object containing cookie values passed from the client
req.headers
Headers received from the client
req.accepts([types])
A convenience method to determine whether the client accepts a given type or types
req.ip
The IP address of the client
req.path
The request path (without protocol, host, port, or querystring)
req.host
A convenience property that returns the hostname reported by the client
req.xhr
A convenience property that returns true if the request originated from an AJAX call
req.protocol
The protocol used in making this request
req.secure
A convenience property that returns true if the connection is secure. Equivalent to req.protocol === ‘https’
req.url
Returns path and querystring (not protocol, host, or port). Can be re-written for internal routing purposes for internal routing purposes