Skip to main content

parse_http_head

Function parse_http_head 

Source
pub fn parse_http_head(head_text: &str) -> Result<HttpHead, NetError>
Expand description

Parse a CRLF-delimited HTTP response head.

Extracted from sim-lib-agent-runner-http’s read_response head parsing. head_text is the head with or without the trailing \r\n\r\n; the status line is the first CRLF-delimited line and the remainder are key: value headers. The status code is the second whitespace-delimited token of the status line, matching the client’s version status split.