Skip to main content

Module codec

Module codec 

Source
Expand description

HTTP/1.1 request serialization and response parsing (status line, headers, and body framing: Content-Length, chunked transfer-encoding, or EOF-delimited).

Structs§

Response
A parsed HTTP response.

Constants§

DEFAULT_MAX_RESPONSE_BYTES
Default ceiling on the total bytes buffered while parsing one response (status line + headers + body). A response — or a malicious/compromised peer trickling bytes — that exceeds this is rejected rather than allowed to drive unbounded allocation. Matches the transport-layer frame cap (16 MiB) scaled up for whole HTTP responses.

Functions§

read_response
Parse a full HTTP response from stream. is_head suppresses body reading.
write_request
Serialize and write an HTTP/1.1 request, then flush.