A Request
object represents the HTTP request and has properties for
the request query string, parameters, body, HTTP headers, and so on.
In this documentation and by convention, the object is always referred to as
req
(and the HTTP response is res
).
parameters
A list containing properties mapped to the named router parameters.
headers
A list of response headers.
path
Contains the path part of the request URL.
method
Contains a string corresponding to the HTTP method of the request: GET, POST, PUT, and so on.
raw
Returns the raw request (req
) object.
type
Contains the body content-type, i.e. "text/html" or "application/json".
body
Contains the data submitted in the request body.
protocol
Contains the request protocol string.
attach(key, value)
Returns a key-value.
getHeader(key)
Returns the key element of the headers
list.
setHeader(key, value)
Attaches a header to headers
list.
addParameters(named_list)
Adds parameters to the named key-value parameters
list.
intialize(req)
Creates a new Request
object by parsing and extracting features of
req
input and populating the object fields.
attach()
Request$attach(key, value)
getHeader()
Request$getHeader(key)
setHeader()
Request$setHeader(key, value)
addParameters()
Request$addParameters(named_list)
new()
Request$new(req)
clone()
The objects of this class are cloneable with this method.
Request$clone(deep = FALSE)
deep
Whether to make a deep clone.