HttpRequest
in package
implements
Request
Class HttpRequest
Tags
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
$internal
private
ServerRequest
$internal
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
Return values
mixed —getAttributes()
public
getAttributes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getBody()
public
getBody() : StreamInterface
Tags
Return values
StreamInterface —getContentCharset()
Get serverRequest content character set, if known.
public
getContentCharset() : string|null
Tags
Return values
string|null —getContentLength()
Get serverRequest content length, if known.
public
getContentLength() : int|null
Tags
Return values
int|null —getContentType()
Get serverRequest content type.
public
getContentType() : string|null
Tags
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
Return values
mixed —getCookieParams()
public
getCookieParams() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getHeader()
public
getHeader(mixed $name) : array<string|int, mixed>
Parameters
- $name : mixed
Tags
Return values
array<string|int, mixed> —getHeaderLine()
public
getHeaderLine(mixed $name) : string
Parameters
- $name : mixed
Tags
Return values
string —getHeaders()
public
getHeaders() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getMediaType()
Get serverRequest media type, if known.
public
getMediaType() : string|null
Tags
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
Return values
array<string|int, mixed> —getMethod()
public
getMethod() : string
Tags
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
Return values
mixed —The parameter value.
getParams()
Fetch associative array of body and query string parameters.
public
getParams() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getParsedBody()
public
getParsedBody() : mixed
Tags
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
Return values
mixed —getProtocolVersion()
public
getProtocolVersion() : string
Tags
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
Return values
mixed —getQueryParams()
public
getQueryParams() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getRequestTarget()
public
getRequestTarget() : string
Tags
Return values
string —getServerParam()
Retrieve a server parameter.
public
getServerParam(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
Tags
Return values
mixed —getServerParams()
public
getServerParams() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getUploadedFiles()
public
getUploadedFiles() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getUri()
public
getUri() : UriInterface
Tags
Return values
UriInterface —hasHeader()
public
hasHeader(mixed $name) : bool
Parameters
- $name : mixed
Tags
Return values
bool —isDelete()
Is this a DELETE serverRequest?
public
isDelete() : bool
Tags
Return values
bool —isGet()
Is this a GET serverRequest?
public
isGet() : bool
Tags
Return values
bool —isHead()
Is this a HEAD serverRequest?
public
isHead() : bool
Tags
Return values
bool —isMethod()
Does this serverRequest use a given method?
public
isMethod(string $method) : bool
Parameters
- $method : string
-
HTTP method
Tags
Return values
bool —isOptions()
Is this a OPTIONS serverRequest?
public
isOptions() : bool
Tags
Return values
bool —isPatch()
Is this a PATCH serverRequest?
public
isPatch() : bool
Tags
Return values
bool —isPost()
Is this a POST serverRequest?
public
isPost() : bool
Tags
Return values
bool —isPut()
Is this a PUT serverRequest?
public
isPut() : bool
Tags
Return values
bool —isXhr()
Is this an XHR serverRequest?
public
isXhr() : bool
Tags
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
Return values
static —withAddedHeader()
public
withAddedHeader(mixed $name, mixed $value) : Request
Parameters
- $name : mixed
- $value : mixed
Tags
Return values
Request —withAttribute()
public
withAttribute(mixed $name, mixed $value) : Request
Parameters
- $name : mixed
- $value : mixed
Tags
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
Return values
static —withBody()
public
withBody(StreamInterface $body) : Request
Parameters
- $body : StreamInterface
Tags
Return values
Request —withCookieParams()
public
withCookieParams(array<string|int, mixed> $cookies) : Request
Parameters
- $cookies : array<string|int, mixed>
Tags
Return values
Request —withHeader()
public
withHeader(mixed $name, mixed $value) : Request
Parameters
- $name : mixed
- $value : mixed
Tags
Return values
Request —withMethod()
public
withMethod(mixed $method) : Request
Parameters
- $method : mixed
Tags
Return values
Request —withoutAttribute()
public
withoutAttribute(mixed $name) : Request
Parameters
- $name : mixed
Tags
Return values
Request —withoutHeader()
public
withoutHeader(mixed $name) : Request
Parameters
- $name : mixed
Tags
Return values
Request —withParsedBody()
public
withParsedBody(mixed $data) : Request
Parameters
- $data : mixed
Tags
Return values
Request —withProtocolVersion()
public
withProtocolVersion(mixed $version) : Request
Parameters
- $version : mixed
Tags
Return values
Request —withQueryParams()
public
withQueryParams(array<string|int, mixed> $query) : Request
Parameters
- $query : array<string|int, mixed>
Tags
Return values
Request —withRequestTarget()
public
withRequestTarget(mixed $requestTarget) : Request
Parameters
- $requestTarget : mixed
Tags
Return values
Request —withUploadedFiles()
public
withUploadedFiles(array<string|int, mixed> $uploadedFiles) : Request
Parameters
- $uploadedFiles : array<string|int, mixed>
Tags
Return values
Request —withUri()
public
withUri(UriInterface $uri[, mixed $preserveHost = false ]) : Request
Parameters
- $uri : UriInterface
- $preserveHost : mixed = false