public int $contentLength
public int $bytesRemaining = -1
private bool $headersParsed
public __construct(?int $status, array $headers, string $version = 'HTTP/1.1'): void
| Parameter | Type | Description |
|---|
$status | int | |
$headers | array | |
$version | string | |
ArrayAccess method to allow access to headers as properties.
public offsetGet(mixed $offset): mixed
| Parameter | Type | Description |
|---|
$offset | mixed | |
ArrayAccess method to allow access to headers as properties.
public offsetSet(mixed $offset, mixed $value): void
| Parameter | Type | Description |
|---|
$offset | mixed | |
$value | mixed | The value to set |
ArrayAccess method to allow access to headers as properties.
public offsetExists(mixed $offset): bool
| Parameter | Type | Description |
|---|
$offset | mixed | |
ArrayAccess method to allow access to headers as properties.
public offsetUnset(mixed $offset): void
| Parameter | Type | Description |
|---|
$offset | mixed | |
public setStatus(int $status): void
| Parameter | Type | Description |
|---|
$status | int | |
public write(string $string): void
| Parameter | Type | Description |
|---|
$string | string | |
public read(string $buffer): bool
| Parameter | Type | Description |
|---|
$buffer | string | |
public hasHeader(string $key): bool
| Parameter | Type | Description |
|---|
$key | string | |
Get a header from the response.
public getHeader(string $header): string
| Parameter | Type | Description |
|---|
$header | string | The header key to get |
public setHeader(string $header, ?string $content): void
| Parameter | Type | Description |
|---|
$header | string | |
$content | string | |
public toString(): string
public getStatusMessage(?int $code): string
| Parameter | Type | Description |
|---|
$code | int | |
Get the content type of the response.
public getContentType(array $args): string
This method will return the content type of the response and optionally return any arguments that were
| Parameter | Type | Description |
|---|
$args | array | The arguments of the content type header will be returned in this array |
public body(bool $raw): mixed
| Parameter | Type | Description |
|---|
$raw | bool | |
public decrypt(string $key, ?string $cipher): bool
| Parameter | Type | Description |
|---|
$key | string | |
$cipher | string | |
Helper function to get the status text for an HTTP response code.
public getText(int $code): void
| Parameter | Type | Description |
|---|
$code | int | the response code |
Generated by Hazaar API Doc Generator on Wed, 07 Jan 2026 11:30:00 +0000