interface RequestInterface implements ServerRequestInterface (View source)

A representation of a request to the server.

Methods

string
getUrl()

Alias for ::getUri().

boolean
isGet()

Check if the request method is GET.

boolean
isHead()

Check if the request method is HEAD.

boolean
isPost()

Check if the request method is POST.

boolean
isPut()

Check if the request method is PUT.

boolean
isPatch()

Check if the request method is PATCH.

boolean
isDelete()

Check if the request method is DELETE.

boolean
isOptions()

Check if the request method is OPTIONS.

boolean
isReadVerb()

Check if the request method is a "read" verb.

boolean
isAjax()

Check if the request is an ajax request.

mixed
attributes(string $key = '', mixed $default = null)

Get a value from the request attributes.

mixed
query(string $key = '', mixed $default = null)

Get a value from the request query (i.e. $_GET).

mixed
body(string $key = '', mixed $default = null)

Get a value from the request body (i.e. $_POST).

mixed
cookies(string $key = '', mixed $default = null)

Get a value from the COOKIE parameters.

mixed
files(string $key = '', mixed $default = null)

Get a value from the FILES parameters.

mixed
server(string $key = '', mixed $default = null)

Get a value from the SERVER parameters.

mixed
headers(string $key = '', mixed $default = null)

Get a value from the headers.

Details

string getUrl()

Alias for ::getUri().

Even though URI and URL are slightly different things this alias returns the URI for simplicity/familiarity.

Return Value

string

boolean isGet()

Check if the request method is GET.

Return Value

boolean

boolean isHead()

Check if the request method is HEAD.

Return Value

boolean

boolean isPost()

Check if the request method is POST.

Return Value

boolean

boolean isPut()

Check if the request method is PUT.

Return Value

boolean

boolean isPatch()

Check if the request method is PATCH.

Return Value

boolean

boolean isDelete()

Check if the request method is DELETE.

Return Value

boolean

boolean isOptions()

Check if the request method is OPTIONS.

Return Value

boolean

boolean isReadVerb()

Check if the request method is a "read" verb.

Return Value

boolean

boolean isAjax()

Check if the request is an ajax request.

Return Value

boolean

mixed attributes(string $key = '', mixed $default = null)

Get a value from the request attributes.

Parameters

string $key
mixed $default

Return Value

mixed

mixed query(string $key = '', mixed $default = null)

Get a value from the request query (i.e. $_GET).

Parameters

string $key
mixed $default

Return Value

mixed

mixed body(string $key = '', mixed $default = null)

Get a value from the request body (i.e. $_POST).

Parameters

string $key
mixed $default

Return Value

mixed

mixed cookies(string $key = '', mixed $default = null)

Get a value from the COOKIE parameters.

Parameters

string $key
mixed $default

Return Value

mixed

mixed files(string $key = '', mixed $default = null)

Get a value from the FILES parameters.

Parameters

string $key
mixed $default

Return Value

mixed

mixed server(string $key = '', mixed $default = null)

Get a value from the SERVER parameters.

Parameters

string $key
mixed $default

Return Value

mixed

mixed headers(string $key = '', mixed $default = null)

Get a value from the headers.

Parameters

string $key
mixed $default

Return Value

mixed