Function hyper::http::read_header [-] [+] [src]

pub fn read_header<R: Read>(stream: &mut R) -> HttpResult<Option<RawHeaderLine>>

Read a RawHeaderLine from a Reader.

From spec:

Each header field consists of a case-insensitive field name followed by a colon (":"), optional leading whitespace, the field value, and optional trailing whitespace.

header-field   = field-name ":" OWS field-value OWS

field-name     = token
field-value    = *( field-content / obs-fold )
field-content  = field-vchar [ 1*( SP / HTAB ) field-vchar ]
field-vchar    = VCHAR / obs-text

obs-fold       = CRLF 1*( SP / HTAB )
               ; obsolete line folding
               ; see Section 3.2.4