Aerys\StandardRequest class StandardRequest implements Aerys\Request

Summary

Properties

Methods

Properties

Methods

__construct — public function __construct(Aerys\InternalRequest $internalRequest)
No documentation.
Type Parameter Description Default Value
Aerys\InternalRequest $internalRequest No documentation. none
getMethod — public function getMethod(): string

Retrieve the HTTP method used to make this request

getUri — public function getUri(): string

Retrieve the request URI in the form /some/resource/foo?bar=1&baz=2

getProtocolVersion — public function getProtocolVersion(): string

Retrieve the HTTP protocol version number used by this request

This method returns the HTTP protocol version (e.g. "1.0", "1.1", "2.0") in use; it has nothing to do with URI schemes like http:// or https:// ...

getHeader — public function getHeader(string $field)

Retrieve the first occurrence of specified header in the message

If multiple headers were received for the specified field only the value of the first header is returned. Applications may use Request::getHeaderArray() to retrieve a list of all header values received for a given field.

All header $field names are treated case-insensitively.

A null return indicates the requested header field was not present.

Type Parameter Description Default Value
string $field No documentation. none
getHeaderArray — public function getHeaderArray(string $field): array

Retrieve the specified header as an array of each of its occurrences in the request

All header $field names are treated case-insensitively.

An empty return array indicates that the header was not present in the request.

Type Parameter Description Default Value
string $field No documentation. none
getAllHeaders — public function getAllHeaders(): array

Retrieve an array of all headers in the message

The returned array uses header names normalized to all-lowercase for simplified querying via isset().

getBody — public function getBody(int $bodySize = -1): Aerys\Body

Retrieve the streaming request entity body.

Note that the returned Body instance may change between calls, the contents not explicitly fetched through its valid() / consume() API, will be moved to the new instance though. No need to buffer and concatenate manually in this case.

Type Parameter Description Default Value
int $bodySize maximum body size -1
getParam — public function getParam(string $name)

Retrieve one query string value of that name

Type Parameter Description Default Value
string $name No documentation. none
getParamArray — public function getParamArray(string $name): array

Retrieve a array of query string values

Type Parameter Description Default Value
string $name No documentation. none
getAllParams — public function getAllParams(): array

Retrieve an associative array of an array of query string values

getCookie — public function getCookie(string $name)

Retrieve a cookie

Type Parameter Description Default Value
string $name No documentation. none
getLocalVar — public function getLocalVar(string $key)

Retrieve a variable from the request's mutable local storage

Each request has its own mutable local storage to which application callables and middleware may read and write data. Other callables which are aware of this data can then access it without the server being tightly coupled to specific implementations.

Type Parameter Description Default Value
string $key No documentation. none
setLocalVar — public function setLocalVar(string $key, mixed $value)

Assign a variable to the request's mutable local storage

Each request has its own mutable local storage to which application callables and middleware may read and write data. Other callables which are aware of this data can then access it without the server being tightly coupled to specific implementations.

Type Parameter Description Default Value
string $key No documentation. none
mixed $value No documentation. none
getConnectionInfo — public function getConnectionInfo(): array

Retrieve an associative array of extended information about the underlying connection

Keys: - client_port - client_addr - server_port - server_addr - is_encrypted - crypto_info = [protocol, cipher_name, cipher_bits, cipher_version]

If the underlying connection is not encrypted the crypto_info array is empty.

getOption — public function getOption(string $option)

Retrieve a server option value

Type Parameter Description Default Value
string $option The option to retrieve none