diff --git a/client.go b/client.go index 823fa05..4b049e5 100644 --- a/client.go +++ b/client.go @@ -156,6 +156,7 @@ func (c *Client) do(req *Request, via []*Request) (*Response, error) { } } + resp.Request = req return resp, nil } diff --git a/response.go b/response.go index 4db127c..4b207e5 100644 --- a/response.go +++ b/response.go @@ -21,6 +21,9 @@ type Response struct { // Body contains the response body for successful responses. Body io.ReadCloser + // Request is the request that was sent to obtain this Response. + Request *Request + // TLS contains information about the TLS connection on which the response // was received. TLS tls.ConnectionState