phpDocumentor

Request extends ServerRequestInterface

Interface Request

Table of Contents

getContentCharset()  : string|null
Get serverRequest content character set, if known.
getContentLength()  : int|null
Get serverRequest content length, if known.
getContentType()  : string|null
Get serverRequest content type.
getCookieParam()  : mixed
Fetch cookie value from cookies sent by the client to the server.
getMediaType()  : string|null
Get serverRequest media type, if known.
getMediaTypeParams()  : array<string|int, mixed>
Get serverRequest media type params, if known.
getParam()  : mixed
Fetch serverRequest parameter value from body or query string (in that order).
getParams()  : array<string|int, mixed>
Fetch associative array of body and query string parameters.
getParsedBodyParam()  : mixed
Fetch parameter value from serverRequest body.
getQueryParam()  : mixed
Fetch parameter value from query string.
getServerParam()  : mixed
Retrieve a server parameter.
isDelete()  : bool
Is this a DELETE serverRequest?
isGet()  : bool
Is this a GET serverRequest?
isHead()  : bool
Is this a HEAD serverRequest?
isMethod()  : bool
Does this serverRequest use a given method?
isOptions()  : bool
Is this a OPTIONS serverRequest?
isPatch()  : bool
Is this a PATCH serverRequest?
isPost()  : bool
Is this a POST serverRequest?
isPut()  : bool
Is this a PUT serverRequest?
isXhr()  : bool
Is this an XHR serverRequest?
registerMediaTypeParser()  : static
Register media type parser.
withAttributes()  : static
Create a new instance with the specified derived request attributes.

Methods

getContentCharset()

Get serverRequest content character set, if known.

public getContentCharset() : string|null

Note: This method is not part of the PSR-7 standard.

Return values
string|null

getContentLength()

Get serverRequest content length, if known.

public getContentLength() : int|null

Note: This method is not part of the PSR-7 standard.

Return values
int|null

getContentType()

Get serverRequest content type.

public getContentType() : string|null

Note: This method is not part of the PSR-7 standard.

Return values
string|null

The serverRequest content type, if known

getCookieParam()

Fetch cookie value from cookies sent by the client to the server.

public getCookieParam(string $key[, mixed $default = null ]) : mixed

Note: This method is not part of the PSR-7 standard.

Parameters
$key : string

The attribute name.

$default : mixed = null

Default value to return if the attribute does not exist.

Return values
mixed

getMediaType()

Get serverRequest media type, if known.

public getMediaType() : string|null

Note: This method is not part of the PSR-7 standard.

Return values
string|null

The serverRequest media type, minus content-type params

getMediaTypeParams()

Get serverRequest media type params, if known.

public getMediaTypeParams() : array<string|int, mixed>

Note: This method is not part of the PSR-7 standard.

Return values
array<string|int, mixed>

getParam()

Fetch serverRequest parameter value from body or query string (in that order).

public getParam(string $key[, string|null $default = null ]) : mixed

Note: This method is not part of the PSR-7 standard.

Parameters
$key : string

The parameter key.

$default : string|null = null

The default value.

Return values
mixed

The parameter value.

getParams()

Fetch associative array of body and query string parameters.

public getParams() : array<string|int, mixed>

Note: This method is not part of the PSR-7 standard.

Return values
array<string|int, mixed>

getParsedBodyParam()

Fetch parameter value from serverRequest body.

public getParsedBodyParam(string $key[, mixed $default = null ]) : mixed

Note: This method is not part of the PSR-7 standard.

Parameters
$key : string
$default : mixed = null
Return values
mixed

getQueryParam()

Fetch parameter value from query string.

public getQueryParam(string $key[, mixed $default = null ]) : mixed

Note: This method is not part of the PSR-7 standard.

Parameters
$key : string
$default : mixed = null
Return values
mixed

getServerParam()

Retrieve a server parameter.

public getServerParam(string $key[, mixed $default = null ]) : mixed

Note: This method is not part of the PSR-7 standard.

Parameters
$key : string
$default : mixed = null
Return values
mixed

isDelete()

Is this a DELETE serverRequest?

public isDelete() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isGet()

Is this a GET serverRequest?

public isGet() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isHead()

Is this a HEAD serverRequest?

public isHead() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isMethod()

Does this serverRequest use a given method?

public isMethod(string $method) : bool

Note: This method is not part of the PSR-7 standard.

Parameters
$method : string

HTTP method

Return values
bool

isOptions()

Is this a OPTIONS serverRequest?

public isOptions() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isPatch()

Is this a PATCH serverRequest?

public isPatch() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isPost()

Is this a POST serverRequest?

public isPost() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isPut()

Is this a PUT serverRequest?

public isPut() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

isXhr()

Is this an XHR serverRequest?

public isXhr() : bool

Note: This method is not part of the PSR-7 standard.

Return values
bool

registerMediaTypeParser()

Register media type parser.

public registerMediaTypeParser(string $mediaType, callable $callable) : static

Note: This method is not part of the PSR-7 standard.

Parameters
$mediaType : string

A HTTP media type (excluding content-type params).

$callable : callable

A callable that returns parsed contents for media type.

Return values
static

withAttributes()

Create a new instance with the specified derived request attributes.

public withAttributes(array<string|int, mixed> $attributes) : static

Note: This method is not part of the PSR-7 standard.

This method allows setting all new derived request attributes as described in getAttributes().

This method MUST be implemented in such a way as to retain the immutability of the message, and MUST return a new instance that has the updated attributes.

Parameters
$attributes : array<string|int, mixed>

New attributes

Return values
static

Search results