Skip to content

ParsedHttpRequest

The result of HttpMessageParser::tryParse() — method, path, headers (lower-cased names), and the fully-buffered request body.

final class ParsedHttpRequest

SourceParsedHttpRequest.php
PropertyTypeDescription
$bodystringreadonly.
$headersarrayreadonly.
$methodstringreadonly.
$pathstringreadonly.

public function __construct(string $method, string $path, array<string, string> $headers, string $body): mixed

header name (lower-case) => value

ParameterTypeDescription
$methodstring
$pathstring
$headersarray``<``string``, ``string``>header name (lower-case) => value
$bodystring

Returns mixed

MethodDescription
header(string $name): ?stringThe value of header $name, matched case-insensitively, or null when the request did not carry it.

public function header(string $name): ?string

The value of header $name, matched case-insensitively, or null when the request did not carry it.

ParameterTypeDescription
$namestring

Returns ?``string