Request Class

Definition

Namespace: DafCore

Phar: DafCore.phar

Implements: IRequest

A request class is a container for information sent by a client to a server.

Methods

function GetRealUrl() : string

Get the url full path.

function GetUrlPath() : string;

Get the url without queryParams.

function GetQueryParams() : array

Get the query parameters.

function GetRouteParams() : array

Get the route parameters.

function SetRouteParams(array $params) : void

Set the route parameters. ( Router:class set the route parameters ).

function GetMethod() : string

Get the request method name.

function GetBody() : RequestBody

Get the parameters for [ POST, PUT, DELETE ] methods as RequestBody that contine the parameters as props.
RequestBody:class extends stdClass

function GetBodyArray() : array

Get the parameters for [ POST, PUT, DELETE ] methods as array.

function GetFiles(): array;

An associative array of items uploaded to the current script via the HTTP POST method.

function GetHeaders() : array

Get the request headers as array.

function GetCookies(): array

Get the request headers as array.

function TryGetCookie(string $name , &$value) : bool

Get the request cookie by key.
if cookie found return true and set the $value to the cookie value else return false.