Type aliasin fsthttpcompute-sdk-go v1.11.0View source
type Header map[string][]string

Alias for map[string][]string.

Header represents the key-value pairs in a set of HTTP headers. Unlike net/http, keys are canonicalized to their lowercase form.

Methods

func (h Header) Add(key, value string)

Add adds the key, value pair to the headers. It appends to any existing values associated with key. The key is case insensitive; it is canonicalized by CanonicalHeaderKey.

Parameters

key: string
value: string
func (h Header) Apply(hs Header)

Apply adds all of the headers in hs. In the case of key conflict, values from hs totally overwrite existing values in h.

Parameters

hs: Header
func (h Header) Clone() Header

Clone returns a copy of the headers.

Returns

func (h Header) Del(key string)

Del deletes the values associated with key. The key is case insensitive; it is canonicalized by CanonicalHeaderKey.

Parameters

key: string
func (h Header) Get(key string) string

Get gets the first value associated with the given key. It is case insensitive; CanonicalHeaderKey is used to canonicalize the provided key. If there are no values associated with the key, Get returns "".

Parameters

key: string

Returns

string
func (h Header) Keys() []string

Keys returns all keys in the header collection.

Returns

[]string
func (h Header) Reset(hs Header)

Reset deletes all existing headers, and adds all of the headers in hs.

Parameters

hs: Header
func (h Header) Set(key, value string)

Set sets the header entries associated with key to the single element value. It replaces any existing values associated with key. The key is case insensitive; it is canonicalized by CanonicalHeaderKey.

Parameters

key: string
value: string
func (h Header) Values(key string) []string

Values returns all values associated with the given key. It is case insensitive; CanonicalHeaderKey is used to canonicalize the provided key. The returned slice is not a copy.

Parameters

key: string

Returns

[]string