InternalRequest in Aerys

This is a value class exposing the whole data of the clients request via public properties. It is only accessible from within Middlewares as well as HttpDriver.

Values marked with a must not be altered in order to not bring the server down.


Holds a reference to the Client.


A Generator instance following the HttpDriver::writer protocol.


An integer (combined with $client->id) providing an unique identifier of a request during its lifetime.


Literal string trace for HTTP/1, for HTTP/2 an array of [name, value] arrays in the original order.


HTTP protocol version string.


HTTP method string.


Associative array of HTTP headers containing arrays of values. The header field names are always lowercased. (E.g. ["connection" => ["Keep-Alive", "Upgrade"], "host" => [""]])


An instance of Body.


Integer describing the current maximum allowed size.

Altering this value should be followed by a call to HttpDriver::upgradeBodySize(InternalRequest).


The URI string consisting of the path and query components.


The raw URI string as sent by the client.


The host string (either from target URI or Host header).


Integer accessed port [may vary from $client->serverPort, if client explicitly specified it].


String path component of the URI.


String query component of the URI.


Cookies array in form of name => value pairs


Unix time at request initialization.


HTTP compatibly formatted date string at request initialization.


Array with “local” variables, to be used by Middlewares in combination with Request::getLocalVar($key) and Request::setLocalVar($key, $value).