WithHeader adds the headers to the HTTP request.
(h map[string]string)
| 354 | |
| 355 | // WithHeader adds the headers to the HTTP request. |
| 356 | func (f Get) WithHeader(h map[string]string) func(*GetRequest) { |
| 357 | return func(r *GetRequest) { |
| 358 | if r.Header == nil { |
| 359 | r.Header = make(http.Header) |
| 360 | } |
| 361 | for k, v := range h { |
| 362 | r.Header.Add(k, v) |
| 363 | } |
| 364 | } |
| 365 | } |
| 366 | |
| 367 | // WithOpaqueID adds the X-Opaque-Id header to the HTTP request. |
| 368 | func (f Get) WithOpaqueID(s string) func(*GetRequest) { |