MCPcopy Index your code
hub / github.com/imroc/req / SetCommonHeader

Method SetCommonHeader

client.go:892–898  ·  view source on GitHub ↗

SetCommonHeader set a header for requests fired from the client.

(key, value string)

Source from the content-addressed store, hash-verified

890
891// SetCommonHeader set a header for requests fired from the client.
892func (c *Client) SetCommonHeader(key, value string) *Client {
893 if c.Headers == nil {
894 c.Headers = make(http.Header)
895 }
896 c.Headers.Set(key, value)
897 return c
898}
899
900// SetCommonHeaderNonCanonical set a header for requests fired from
901// the client which key is a non-canonical key (keep case unchanged),

Callers 10

SetUserAgentMethod · 0.95
SetCommonBasicAuthMethod · 0.95
SetCommonHeadersMethod · 0.95
SetCommonContentTypeMethod · 0.95
LoginWithTokenMethod · 0.95
TestSetCommonHeaderFunction · 0.80
TestClientCloneFunction · 0.80
SetCommonHeaderFunction · 0.80
NewClientFunction · 0.80

Calls

no outgoing calls

Tested by 2

TestSetCommonHeaderFunction · 0.64
TestClientCloneFunction · 0.64