Header contains the request header fields either received by the server or to be sent by the client.

If a server received a request with header lines,

Host: example.com accept-encoding: gzip, deflate Accept-Language: en-us fOO: Bar foo: two

then

let header = {
"Accept-Encoding": {"gzip, deflate"},
"Accept-Language": {"en-us"},
"Foo": {"Bar", "two"},
}

For incoming requests, the Host header is promoted to the Request.Host field and removed from the Header map.

HTTP defines that header names are case-insensitive. The request parser implements this by using CanonicalHeaderKey, making the first character and any characters following a hyphen uppercase and the rest lowercase.

For client requests, certain headers such as Content-Length and Connection are automatically written when needed and values in Header may be ignored. See the documentation for the Request.Write method.

interface Header {
    [id: string]: string | string[];
}

Indexable

[id: string]: string | string[]