Skip to main content

Module http

Module http 

Source
Expand description

Sans-IO HTTP/1.x protocol primitives.

Built on httparse for SIMD-accelerated header parsing. Uses ReadBuf for incremental byte buffering.

The HTTP client API is in rest. RequestReader is internal (used for WebSocket upgrade handshake).

Structs§

ChunkedDecoder
Sans-IO chunked transfer-encoding decoder.
RequestReader
Sans-IO HTTP/1.x request parser.
Response
A parsed HTTP/1.x response. Borrows from the reader’s buffer.
ResponseReader
Sans-IO HTTP/1.x response parser.

Enums§

HttpError
HTTP parsing error.

Constants§

HTTP_HANDSHAKE_BUFFER
Default capacity for HTTP read/decode/scratch buffers.

Functions§

request_size
Compute the exact size needed for a request.
response_size
Compute the exact size needed for a response.
write_request
Write an HTTP/1.1 request into a byte buffer. Returns bytes written.
write_response
Write an HTTP/1.1 response into a byte buffer. Returns bytes written.