Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ModifyRequestHeaders ¶
ModifyRequestHeaders directly modifies the supplied request's headers. Existing headers will be overwritten with the values in set. Existing headers, including those set here, will be appeneded to with the values in add. Headers that are not in set or add will remain unmodified.
Types ¶
type Transport ¶
type Transport struct { // Base is the RoundTripper that will be used after the request headers // are modified. If nil, http.DefaultTransport will be used. Base http.RoundTripper // Set contains the headers that will be overwritten using `http.Header.Set`. Set http.Header // Add contains the headers that will be appended using `http.Header.Add`. Add http.Header }
Transport will modify the headers of the out-bound request using the values in Set and Add before using Base to perform the RoundTrip. Values in Set will be applied before values in Add.
func (Transport) RoundTrip ¶
RoundTrip modifies the headers of the out-bound request using the values in Set and Add before using Base to perform the RoundTrip. If Base is not set, http.DefaultTransport will be used. If both Set and Add are empty, the request is sent unmodified. If Set or Add have values, the request is cloned before modification, and the clone will be modified (per the RoundTripper contract) and sent.