RequestFactory
in package
Used to produce PSR-7 Request instances.
Tags
Table of Contents
Methods
- getRequest() : Request
- Creates a PSR-7 Request instance.
- getRequestWithOptions() : Request
- Creates a request using a simplified array of options.
- parseOptions() : array<string|int, mixed>
- Parses simplified options.
Methods
getRequest()
Creates a PSR-7 Request instance.
public
getRequest(null|string $method, null|string $uri[, array<string|int, mixed> $headers = [] ][, string|resource|StreamInterface $body = null ][, string $version = '1.1' ]) : Request
Parameters
- $method : null|string
-
HTTP method for the request.
- $uri : null|string
-
URI for the request.
- $headers : array<string|int, mixed> = []
-
Headers for the message.
- $body : string|resource|StreamInterface = null
-
Message body.
- $version : string = '1.1'
-
HTTP protocol version.
Return values
RequestgetRequestWithOptions()
Creates a request using a simplified array of options.
public
getRequestWithOptions(null|string $method, null|string $uri[, array<string|int, mixed> $options = [] ]) : Request
Parameters
- $method : null|string
- $uri : null|string
- $options : array<string|int, mixed> = []
Return values
RequestparseOptions()
Parses simplified options.
protected
parseOptions(array<string|int, mixed> $options) : array<string|int, mixed>
Parameters
- $options : array<string|int, mixed>
-
Simplified options.
Return values
array<string|int, mixed> —Extended options for use with getRequest.