parseHeaders

Parses HTTP headers from an input stream, and returns them as an associative array mapping header names to their list of values.

Either!(string[][string], "headers", StreamError, "error")
parseHeaders
(
S
)
if (
isByteInputStream!S
)

Parameters

inputStream S

The byte input stream to read from. Note that this stream should be passed as a pointer / reference, values will be consumed from the stream.

Return Value

Type: Either!(string[][string], "headers", StreamError, "error")

Either the headers, or a stream error.