github.com/coreos/goproxy@v0.0.0-20190513173959-f8dc2d7ba04e/transport/roundtripper.go (about)

     1  package transport
     2  import "net/http"
     3  type RoundTripper interface {
     4  	// RoundTrip executes a single HTTP transaction, returning
     5  	// the Response for the request req.  RoundTrip should not
     6  	// attempt to interpret the response.  In particular,
     7  	// RoundTrip must return err == nil if it obtained a response,
     8  	// regardless of the response's HTTP status code.  A non-nil
     9  	// err should be reserved for failure to obtain a response.
    10  	// Similarly, RoundTrip should not attempt to handle
    11  	// higher-level protocol details such as redirects,
    12  	// authentication, or cookies.
    13  	//
    14  	// RoundTrip should not modify the request, except for
    15  	// consuming the Body.  The request's URL and Header fields
    16  	// are guaranteed to be initialized.
    17  	RoundTrip(*http.Request) (*http.Response, error)
    18  	DetailedRoundTrip(*http.Request) (*RoundTripDetails, *http.Response, error)
    19  }