Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CloneRequest ¶
CloneRequest returns a clone of the provided *http.Request. The clone is a shallow copy of the struct and its Header map.
func NewTransport ¶
func NewTransport(base http.RoundTripper, modifiers ...RequestModifier) http.RoundTripper
NewTransport returns an http.RoundTripper that modifies requests according to the RequestModifiers passed in the arguments, before sending the requests to the base http.RoundTripper (which, if nil, defaults to http.DefaultTransport).
Types ¶
type OnEOFReader ¶
type OnEOFReader struct { Rc io.ReadCloser Fn func() }
OnEOFReader ensures a callback function is called on Close() and when the underlying Reader returns an io.EOF error
func (*OnEOFReader) Close ¶
func (r *OnEOFReader) Close() error
type RequestModifier ¶
func NewHeaderRequestModifier ¶
func NewHeaderRequestModifier(header http.Header) RequestModifier
NewHeaderRequestModifier returns a RequestModifier that merges the HTTP headers passed as an argument, with the HTTP headers of a request.
If the same key is present in both, the modifying header values for that key, are appended to the values for that same key in the request header.