std :: http::headers
Struct std::HttpHeaders
struct HttpHeaders {
struct Vec<struct HttpHeaderField> fields;
}Fields
Methods
Parses a raw "Key: value" block (lines end in "\r\n" or "\n"; a line without ':' is skipped; leading/trailing blanks are trimmed; an obsolete folded continuation line — leading space/tab — is joined onto the previous value with one space).
The first value for 'name' (any case), or null. The reference aliases this object's storage: valid until the next mutation/free().
How many fields have this name, and the n-th one's value.
Every value for 'name' joined with ", " (the RFC 9110 §5.3 combination; empty String if absent). Not meaningful for Set-Cookie.
1 if 'name' holds a comma-separated list containing 'token' (case- insensitive), e.g. contains_token("Connection", "upgrade").
i-th field in order (null past the end).
Adds a field at the end, keeping any existing ones with this name.
Replaces the first field with this name (keeping its position) and drops the others; appends one if there was none.
Removes every field with this name; returns how many there were.
"Name: value\r\n" per field (CRLF after every line, including the last), appended to 'out' — the shape a request/response header block is sent in.
The raw block form HttpRequest/HttpResponse store: lines CRLF- separated, no trailing CRLF.
= drop()