MCPcopy
hub / github.com/valyala/fasthttp / Set

Method Set

header.go:1828–1831  ·  view source on GitHub ↗

Set sets the given 'key: value' header. Please note that the Cookie header will not clear previous cookies, delete cookies before calling in order to reset cookies. If the header is set as a Trailer (forbidden trailers will not be set, see SetTrailer for more details), it will be sent after the ch

(key, value string)

Source from the content-addressed store, hash-verified

1826//
1827// Use Add for setting multiple header values under the same key.
1828func (h *RequestHeader) Set(key, value string) {
1829 h.bufK, h.bufV = initHeaderKV(h.bufK, h.bufV, key, value, h.disableNormalizing)
1830 h.SetCanonical(h.bufK, h.bufV)
1831}
1832
1833// SetBytesK sets the given 'key: value' header.
1834//

Calls 2

SetCanonicalMethod · 0.95
initHeaderKVFunction · 0.85