create a new request with the provided headers
(method, url string, headers ...string)
| 2996 | |
| 2997 | // create a new request with the provided headers |
| 2998 | func newRequestWithHeaders(method, url string, headers ...string) *http.Request { |
| 2999 | req := newRequest(method, url) |
| 3000 | |
| 3001 | if len(headers)%2 != 0 { |
| 3002 | panic(fmt.Sprintf("Expected headers length divisible by 2 but got %v", len(headers))) |
| 3003 | } |
| 3004 | |
| 3005 | for i := 0; i < len(headers); i += 2 { |
| 3006 | req.Header.Set(headers[i], headers[i+1]) |
| 3007 | } |
| 3008 | |
| 3009 | return req |
| 3010 | } |
| 3011 | |
| 3012 | // newRequestHost a new request with a method, url, and host header |
| 3013 | func newRequestHost(method, url, host string) *http.Request { |
no test coverage detected