Store a reference to the Request in Response

This commit is contained in:
Adnan Maolood 2020-10-28 00:21:27 -04:00
parent e6072d8bbc
commit 7a1a33513a
2 changed files with 4 additions and 0 deletions

View File

@ -156,6 +156,7 @@ func (c *Client) do(req *Request, via []*Request) (*Response, error) {
}
}
resp.Request = req
return resp, nil
}

View File

@ -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