Closed wrunk closed 7 years ago
👍 I love using httputil.DumpRequest and would love to see something similar here.
@sandro What do you think about https://github.com/mozillazg/request/pull/18
@mozillazg I like the idea of adding hooks. It allows folks to do things beyond dumping the request, things we can't even think of right now. Very flexible. You could also export the actual http request and response structs from the request.Request and request.Response structs.
@sandro You can access actual http response via request.Response.Response.
When using regular net/http go provides a nice net/http/httputil package for dumping the outgoing request via:
httputil.DumpRequest
I'm wondering how we could optionally expose this for debugging purposes (super useful for integration tests over HTTP).