Zend Framework
3.0
|
Server-side HTTP request. More...
Public Member Functions | |
__construct (array $serverParams=[], array $uploadedFiles=[], $uri=null, $method=null, $body= 'php://input', array $headers=[], array $cookies=[], array $queryParams=[], $parsedBody=null, $protocol= '1.1') | |
getServerParams () | |
{} | |
getUploadedFiles () | |
{} | |
withUploadedFiles (array $uploadedFiles) | |
{} | |
getCookieParams () | |
{} | |
withCookieParams (array $cookies) | |
{} | |
getQueryParams () | |
{} | |
withQueryParams (array $query) | |
{} | |
getParsedBody () | |
{} | |
withParsedBody ($data) | |
{} | |
getAttributes () | |
{} | |
getAttribute ($attribute, $default=null) | |
{} | |
withAttribute ($attribute, $value) | |
{} | |
withoutAttribute ($attribute) | |
{} | |
getMethod () | |
Proxy to receive the request method. | |
withMethod ($method) | |
Set the request method. | |
Server-side HTTP request.
Extends the Request definition to add methods for accessing incoming data, specifically server parameters, cookies, matched path parameters, query string arguments, body parameters, and upload file information.
"Attributes" are discovered via decomposing the request (and usually specifically the URI path), and typically will be injected by the application.
Requests are considered immutable; all methods that might change state are implemented such that they retain the internal state of the current message and return a new instance that contains the changed state.
__construct | ( | array | $serverParams = [] , |
array | $uploadedFiles = [] , |
||
$uri = null , |
|||
$method = null , |
|||
$body = 'php://input' , |
|||
array | $headers = [] , |
||
array | $cookies = [] , |
||
array | $queryParams = [] , |
||
$parsedBody = null , |
|||
$protocol = '1.1' |
|||
) |
array | $serverParams | Server parameters, typically from $_SERVER |
array | $uploadedFiles | Upload file information, a tree of UploadedFiles |
null | string | $uri | URI for the request, if any. |
null | string | $method | HTTP method for the request, if any. |
string | resource | StreamInterface | $body | Message body, if any. |
array | $headers | Headers for the message, if any. |
array | $cookies | Cookies for the message, if any. |
array | $queryParams | Query params for the message, if any. |
null | array | object | $parsedBody | The deserialized body parameters, if any. |
string | $protocol | HTTP protocol version. |
InvalidArgumentException | for any invalid value. |
getAttribute | ( | $attribute, | |
$default = null |
|||
) |
{}
getAttributes | ( | ) |
{}
getCookieParams | ( | ) |
{}
getMethod | ( | ) |
Proxy to receive the request method.
This overrides the parent functionality to ensure the method is never empty; if no method is present, it returns 'GET'.
getParsedBody | ( | ) |
{}
getQueryParams | ( | ) |
{}
getServerParams | ( | ) |
{}
getUploadedFiles | ( | ) |
{}
withAttribute | ( | $attribute, | |
$value | |||
) |
{}
withCookieParams | ( | array | $cookies | ) |
{}
withMethod | ( | $method | ) |
Set the request method.
Unlike the regular Request implementation, the server-side normalizes the method to uppercase to ensure consistency and make checking the method simpler.
This methods returns a new instance.
string | $method |
withoutAttribute | ( | $attribute | ) |
{}
withParsedBody | ( | $data | ) |
{}
withQueryParams | ( | array | $query | ) |
{}
withUploadedFiles | ( | array | $uploadedFiles | ) |
{}