RequestInterface
interface RequestInterface implements ServerRequestInterface (View source)
A representation of a request to the server.
Methods
Alias for ::getUri().
Check if the request method is GET.
Check if the request method is HEAD.
Check if the request method is POST.
Check if the request method is PUT.
Check if the request method is PATCH.
Check if the request method is DELETE.
Check if the request method is OPTIONS.
Check if the request method is a "read" verb.
Check if the request is an ajax request.
Get a value from the request attributes.
Get a value from the request query (i.e. $_GET).
Get a value from the request body (i.e. $_POST).
Get a value from the COOKIE parameters.
Get a value from the FILES parameters.
Get a value from the SERVER parameters.
Get a value from the headers.
Details
at line 24
string
getUrl()
Alias for ::getUri().
Even though URI and URL are slightly different things this alias returns the URI for simplicity/familiarity.
at line 31
boolean
isGet()
Check if the request method is GET.
at line 38
boolean
isHead()
Check if the request method is HEAD.
at line 45
boolean
isPost()
Check if the request method is POST.
at line 52
boolean
isPut()
Check if the request method is PUT.
at line 59
boolean
isPatch()
Check if the request method is PATCH.
at line 66
boolean
isDelete()
Check if the request method is DELETE.
at line 73
boolean
isOptions()
Check if the request method is OPTIONS.
at line 80
boolean
isReadVerb()
Check if the request method is a "read" verb.
at line 87
boolean
isAjax()
Check if the request is an ajax request.
at line 96
mixed
attributes(string $key = '', mixed $default = null)
Get a value from the request attributes.
at line 105
mixed
query(string $key = '', mixed $default = null)
Get a value from the request query (i.e. $_GET).
at line 114
mixed
body(string $key = '', mixed $default = null)
Get a value from the request body (i.e. $_POST).
at line 123
mixed
cookies(string $key = '', mixed $default = null)
Get a value from the COOKIE parameters.
at line 132
mixed
files(string $key = '', mixed $default = null)
Get a value from the FILES parameters.
at line 141
mixed
server(string $key = '', mixed $default = null)
Get a value from the SERVER parameters.
at line 150
mixed
headers(string $key = '', mixed $default = null)
Get a value from the headers.