MCPcopy Create free account
hub / github.com/imroc/req / SetHeader

Method SetHeader

request.go:482–488  ·  view source on GitHub ↗

SetHeader set a header for the request.

(key, value string)

Source from the content-addressed store, hash-verified

480
481// SetHeader set a header for the request.
482func (r *Request) SetHeader(key, value string) *Request {
483 if r.Headers == nil {
484 r.Headers = make(http.Header)
485 }
486 r.Headers.Set(key, value)
487 return r
488}
489
490// SetHeadersNonCanonical set headers from a map for the request which key is a
491// non-canonical key (keep case unchanged), only valid for HTTP/1.1.

Callers 9

SetBearerAuthTokenMethod · 0.95
SetBasicAuthMethod · 0.95
SetHeadersMethod · 0.95
SetContentTypeMethod · 0.95
handleTaskMethod · 0.80
SetHeaderFunction · 0.80
testHeaderFunction · 0.80
testHostHeaderOverrideFunction · 0.80
findTheMostPopularRepoFunction · 0.80

Calls

no outgoing calls

Tested by 2

testHeaderFunction · 0.64
testHostHeaderOverrideFunction · 0.64