MCPcopy Create free account
hub / github.com/kataras/iris / RequestHeader

Function RequestHeader

x/client/client.go:146–158  ·  view source on GitHub ↗

RequestHeader adds or sets (if overridePrev is true) a header to the request.

(overridePrev bool, key string, values ...string)

Source from the content-addressed store, hash-verified

144
145// RequestHeader adds or sets (if overridePrev is true) a header to the request.
146func RequestHeader(overridePrev bool, key string, values ...string) RequestOption {
147 key = http.CanonicalHeaderKey(key)
148
149 return func(req *http.Request) error {
150 if overridePrev { // upsert.
151 req.Header[key] = values
152 } else { // just insert.
153 req.Header[key] = append(req.Header[key], values...)
154 }
155
156 return nil
157 }
158}
159
160// RequestAuthorization sets an Authorization request header.
161// Note that we could do the same with a Transport RoundDrip too.

Callers 7

client.goFile · 0.85
RequestAuthorizationFunction · 0.85
JSONMethod · 0.85
FormMethod · 0.85
UploadMethod · 0.85
ReadJSONMethod · 0.85
WriteToMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…