The class Pages\Request exists, so it gets very easy to access all data related to a request.
Due to all of its data members being public, it is also very easy to set up Pages\Request
instances for testing, if the type of the request is hinted.
string $methodContains the HTTP verb used for the request in upper case (e.g.GETorPOST)string $pathContains the path of the URI after the FQDN and portarray $paramsContains all parameters which have been defined in the route and fetched from the$patharray $filesContaines all files sent with the request. The key is the same as in the original form, but the value is an instance ofPages\RequestFile, which wraps the standardarray $cookiesContains all cookies sent with the requestarray $headersContains all request HTTP headersarray $queryContains all values provided in the query string a.k.a. GET parametersarray $bodyContains all POST fields of a requestarray $validation_errorsConains all validation error which were found in the requestbool $httpsSpecifies whether the request is made over HTTPS or HTTPstring $server_nameContains the server name (FQDN)int $server_portThe port to which the request has been sent
Pages\Request::from_current_request(array& $params = []): Pages\RequestThis static helper builds an instance ofPages\Requestbased on the data of PHP's superglobals of the current request