phpDocumentor

HttpRequest implements Request

Class HttpRequest

Tags
codeCoverageIgnore

Interfaces, Classes and Traits

Request
Interface Request

Table of Contents

$internal  : ServerRequest
__construct()  : mixed
Request constructor.
getAttribute()  : mixed
getAttributes()  : array<string|int, mixed>
getBody()  : StreamInterface
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.
getCookieParams()  : array<string|int, mixed>
getHeader()  : array<string|int, mixed>
getHeaderLine()  : string
getHeaders()  : array<string|int, mixed>
getMediaType()  : string|null
Get serverRequest media type, if known.
getMediaTypeParams()  : array<string|int, mixed>
Get serverRequest media type params, if known.
getMethod()  : string
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.
getParsedBody()  : mixed
getParsedBodyParam()  : mixed
Fetch parameter value from serverRequest body.
getProtocolVersion()  : string
getQueryParam()  : mixed
Fetch parameter value from query string.
getQueryParams()  : array<string|int, mixed>
getRequestTarget()  : string
getServerParam()  : mixed
Retrieve a server parameter.
getServerParams()  : array<string|int, mixed>
getUploadedFiles()  : array<string|int, mixed>
getUri()  : UriInterface
hasHeader()  : bool
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.
withAddedHeader()  : Request
withAttribute()  : Request
withAttributes()  : static
Create a new instance with the specified derived request attributes.
withBody()  : Request
withCookieParams()  : Request
withHeader()  : Request
withMethod()  : Request
withoutAttribute()  : Request
withoutHeader()  : Request
withParsedBody()  : Request
withProtocolVersion()  : Request
withQueryParams()  : Request
withRequestTarget()  : Request
withUploadedFiles()  : Request
withUri()  : Request

Properties

Methods

__construct()

Request constructor.

public __construct(ServerRequest $internal) : mixed
Parameters
$internal : ServerRequest
Return values
mixed

getAttribute()

public getAttribute(mixed $name[, mixed $default = null ]) : mixed
Parameters
$name : mixed
$default : mixed = null
Tags
inheritdoc
Return values
mixed

getAttributes()

public getAttributes() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getBody()

public getBody() : StreamInterface
Tags
inheritdoc
Return values
StreamInterface

getContentCharset()

Get serverRequest content character set, if known.

public getContentCharset() : string|null
Tags
inheritdoc
Return values
string|null

getContentLength()

Get serverRequest content length, if known.

public getContentLength() : int|null
Tags
inheritdoc
Return values
int|null

getContentType()

Get serverRequest content type.

public getContentType() : string|null
Tags
inheritdoc
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
Parameters
$key : string

The attribute name.

$default : mixed = null

Default value to return if the attribute does not exist.

Tags
inheritdoc
Return values
mixed

getCookieParams()

public getCookieParams() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getHeader()

public getHeader(mixed $name) : array<string|int, mixed>
Parameters
$name : mixed
Tags
inheritdoc
Return values
array<string|int, mixed>

getHeaderLine()

public getHeaderLine(mixed $name) : string
Parameters
$name : mixed
Tags
inheritdoc
Return values
string

getHeaders()

public getHeaders() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getMediaType()

Get serverRequest media type, if known.

public getMediaType() : string|null
Tags
inheritdoc
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>
Tags
inheritdoc
Return values
array<string|int, mixed>

getMethod()

public getMethod() : string
Tags
inheritdoc
Return values
string

getParam()

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

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

The parameter key.

$default : mixed = null

The default value.

Tags
inheritdoc
Return values
mixed

The parameter value.

getParams()

Fetch associative array of body and query string parameters.

public getParams() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getParsedBody()

public getParsedBody() : mixed
Tags
inheritdoc
Return values
mixed

getParsedBodyParam()

Fetch parameter value from serverRequest body.

public getParsedBodyParam(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Tags
inheritdoc
Return values
mixed

getProtocolVersion()

public getProtocolVersion() : string
Tags
inheritdoc
Return values
string

getQueryParam()

Fetch parameter value from query string.

public getQueryParam(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Tags
inheritdoc
Return values
mixed

getQueryParams()

public getQueryParams() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getRequestTarget()

public getRequestTarget() : string
Tags
inheritdoc
Return values
string

getServerParam()

Retrieve a server parameter.

public getServerParam(string $key[, mixed $default = null ]) : mixed
Parameters
$key : string
$default : mixed = null
Tags
inheritdoc
Return values
mixed

getServerParams()

public getServerParams() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getUploadedFiles()

public getUploadedFiles() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getUri()

public getUri() : UriInterface
Tags
inheritdoc
Return values
UriInterface

hasHeader()

public hasHeader(mixed $name) : bool
Parameters
$name : mixed
Tags
inheritdoc
Return values
bool

isDelete()

Is this a DELETE serverRequest?

public isDelete() : bool
Tags
inheritdoc
Return values
bool

isGet()

Is this a GET serverRequest?

public isGet() : bool
Tags
inheritdoc
Return values
bool

isHead()

Is this a HEAD serverRequest?

public isHead() : bool
Tags
inheritdoc
Return values
bool

isMethod()

Does this serverRequest use a given method?

public isMethod(string $method) : bool
Parameters
$method : string

HTTP method

Tags
inheritdoc
Return values
bool

isOptions()

Is this a OPTIONS serverRequest?

public isOptions() : bool
Tags
inheritdoc
Return values
bool

isPatch()

Is this a PATCH serverRequest?

public isPatch() : bool
Tags
inheritdoc
Return values
bool

isPost()

Is this a POST serverRequest?

public isPost() : bool
Tags
inheritdoc
Return values
bool

isPut()

Is this a PUT serverRequest?

public isPut() : bool
Tags
inheritdoc
Return values
bool

isXhr()

Is this an XHR serverRequest?

public isXhr() : bool
Tags
inheritdoc
Return values
bool

registerMediaTypeParser()

Register media type parser.

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

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

$callable : callable

A callable that returns parsed contents for media type.

Tags
inheritdoc
Return values
static

withAddedHeader()

public withAddedHeader(mixed $name, mixed $value) : Request
Parameters
$name : mixed
$value : mixed
Tags
inheritdoc
Return values
Request

withAttribute()

public withAttribute(mixed $name, mixed $value) : Request
Parameters
$name : mixed
$value : mixed
Tags
inheritdoc
Return values
Request

withAttributes()

Create a new instance with the specified derived request attributes.

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

New attributes

Tags
inheritdoc
Return values
static

withBody()

public withBody(StreamInterface $body) : Request
Parameters
$body : StreamInterface
Tags
inheritdoc
Return values
Request

withCookieParams()

public withCookieParams(array<string|int, mixed> $cookies) : Request
Parameters
$cookies : array<string|int, mixed>
Tags
inheritdoc
Return values
Request

withHeader()

public withHeader(mixed $name, mixed $value) : Request
Parameters
$name : mixed
$value : mixed
Tags
inheritdoc
Return values
Request

withMethod()

public withMethod(mixed $method) : Request
Parameters
$method : mixed
Tags
inheritdoc
Return values
Request

withoutAttribute()

public withoutAttribute(mixed $name) : Request
Parameters
$name : mixed
Tags
inheritdoc
Return values
Request

withoutHeader()

public withoutHeader(mixed $name) : Request
Parameters
$name : mixed
Tags
inheritdoc
Return values
Request

withParsedBody()

public withParsedBody(mixed $data) : Request
Parameters
$data : mixed
Tags
inheritdoc
Return values
Request

withProtocolVersion()

public withProtocolVersion(mixed $version) : Request
Parameters
$version : mixed
Tags
inheritdoc
Return values
Request

withQueryParams()

public withQueryParams(array<string|int, mixed> $query) : Request
Parameters
$query : array<string|int, mixed>
Tags
inheritdoc
Return values
Request

withRequestTarget()

public withRequestTarget(mixed $requestTarget) : Request
Parameters
$requestTarget : mixed
Tags
inheritdoc
Return values
Request

withUploadedFiles()

public withUploadedFiles(array<string|int, mixed> $uploadedFiles) : Request
Parameters
$uploadedFiles : array<string|int, mixed>
Tags
inheritdoc
Return values
Request

withUri()

public withUri(UriInterface $uri[, mixed $preserveHost = false ]) : Request
Parameters
$uri : UriInterface
$preserveHost : mixed = false
Tags
inheritdoc
Return values
Request

Search results