ParsedHttpRequest
The result of HttpMessageParser::tryParse() — method, path, headers (lower-cased names), and the fully-buffered request body.
Synopsis
Section titled “Synopsis”final class ParsedHttpRequest
| Source | ParsedHttpRequest.php |
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
$body | string | readonly. |
$headers | array | readonly. |
$method | string | readonly. |
$path | string | readonly. |
Constructor
Section titled “Constructor”__construct()
Section titled “__construct()”public function __construct(string $method, string $path, array<string, string> $headers, string $body): mixed
header name (lower-case) => value
| Parameter | Type | Description |
|---|---|---|
$method | string | |
$path | string | |
$headers | array``<``string``, ``string``> | header name (lower-case) => value |
$body | string |
Returns mixed
Methods
Section titled “Methods”| Method | Description |
|---|---|
header(string $name): ?string | The value of header $name, matched case-insensitively, or null when the request did not carry it. |
header()
Section titled “header()”public function header(string $name): ?string
The value of header $name, matched case-insensitively, or null when the request did not carry it.
| Parameter | Type | Description |
|---|---|---|
$name | string |
Returns ?``string