API / $request

Represents an incoming HTTP request. This object can be used to access all values from an incoming request

Name Description
getMethod Returns the HTTP request method i.e. GET, POST
getHeader Returns a specific header or return null in case the header is not available
getHeaders Returns all available headers
getUriFragment Returns a specific fragment from the uri. To specify a fragment your route must contain a variable fragment i.e. /foo/:bar, then it is possible to access the bar fragment through this method
getUriFragments Returns all available uri fragments
getParameter Returns a query parameter from the uri. Those are parsed by the parse_str function so the value is either a string or an array in case the parameter uses a "[]" notation
getParameters Returns all available query parameters
getBody Returns the parsed body. If the body arrives at the action it is already valid against the defined JSON schema (if provided)
withBody Returns a copy of the request object with the provided body