Skip to main content

Module h1

Module h1 

Source
Expand description

HTTP/1.x parsing utilities

Structs§

HttpRequest
HTTP request parsed from any HTTP version
HttpResponse
HTTP response parsed from any HTTP version

Functions§

is_http1_request
Check if data starts with an HTTP/1.x request
is_http1_response
Check if data starts with an HTTP/1.x response
try_finalize_http1_response
Finalize an HTTP/1.x response when the connection closes.
try_parse_http1_request
Try to parse an HTTP/1.x request, returning Some only if complete. This combines header parsing and body completeness checking in one pass.
try_parse_http1_request_sized
Try to parse an HTTP/1.x request, returning both the parsed message and the number of bytes consumed from data (headers + body). Enables the caller to drain those bytes and parse any pipelined follow-on request.
try_parse_http1_response
Try to parse an HTTP/1.x response, returning Some only if complete. This combines header parsing and body completeness checking in one pass.
try_parse_http1_response_sized
Try to parse an HTTP/1.x response, returning both the parsed message and the number of bytes consumed from data. Enables the caller to drain those bytes and parse any pipelined follow-on response.