API / Minn\Http / RawResponse

RawResponse final class

Minn\Http\RawResponse · public/minn/src/Minn/Http/RawResponse.php · 105 lines

An HTTP response as text, the way the Requests library hands it from transport to parser: the status line and headers, a blank line, the body. Built from an exchange, split back up, chunked bodies joined and compressed ones inflated.

Public

staticfromExchange(Minn\Http\Exchange $exchange): string#

The exchange as raw response text: its status line, header lines, a blank line, the body.

staticparse(string $raw): array#

The text split into protocol, status, header pairs (folded lines joined) and body.

@return array{protocol: float, status: int, headers: list<array{0: string, 1: string}>, body: string}
staticparseHead(string $head): array#

A head alone (the body went to a file): protocol, status, header pairs, and an empty body.

@return array{protocol: float, status: int, headers: list<array{0: string, 1: string}>, body: string}
staticunchunk(string $body): string#

A chunked body joined; text that is not chunked comes back as it was.

staticinflateLoose(string $data): string|false#

A gzip body inflated past its header fields (extra, name, comment, header CRC) and trailer, or a zlib one past its two-byte header, as WP_Http_Encoding::compatible_gzinflate reads them; false when neither inflates.

staticinflate(string $data): string#

A gzip or zlib body inflated; anything else (raw deflate included) comes back as it was.