http.RoundTripper

The Go interface for the part of an HTTP client that actually sends one request and returns one response.

In more detail

An http.Client delegates to its Transport, which is a RoundTripper. Swapping in a fake one lets tests return fixed responses with no network. The default transport pools and reuses connections.

Example

client := &http.Client{Transport: fake{}}

Related terms

Taught in

References