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