class Http implements Http

Methods

static string
packRequest(string $method, string|Stringable $path, array $headers = [], string|Stringable $body = '', string $protocolVersion = HttpContract::DEFAULT_PROTOCOL_VERSION)

Pack an HTTP request into a string.

static string
packResponse(int $statusCode, string $reasonPhrase = '', array $headers = [], string|Stringable $body = '', string $protocolVersion = HttpContract::DEFAULT_PROTOCOL_VERSION)

Pack an HTTP response into a string.

Details

at line 15
static string packRequest(string $method, string|Stringable $path, array $headers = [], string|Stringable $body = '', string $protocolVersion = HttpContract::DEFAULT_PROTOCOL_VERSION)

Pack an HTTP request into a string.

Parameters

string $method
string|Stringable $path
array $headers
string|Stringable $body
string $protocolVersion

Return Value

string

at line 37
static string packResponse(int $statusCode, string $reasonPhrase = '', array $headers = [], string|Stringable $body = '', string $protocolVersion = HttpContract::DEFAULT_PROTOCOL_VERSION)

Pack an HTTP response into a string.

Parameters

int $statusCode
string $reasonPhrase
array $headers
string|Stringable $body
string $protocolVersion

Return Value

string