Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: add possibility to debug response inside CheckRedirect #12697

Closed
kayrus opened this issue Sep 19, 2015 · 3 comments

Comments

Projects
None yet
4 participants
@kayrus
Copy link

commented Sep 19, 2015

Right now it is not possible to debug server response inside CheckRedirect function. It becomes annoying especially when you use HTTPS connection and can not figure out why your code doesn't work.

I suppose it should be like:

CheckRedirect func(req *Request, via []*Request, via_resp []*Response,) error
@minux

This comment has been minimized.

Copy link
Member

commented Sep 19, 2015

@kayrus

This comment has been minimized.

Copy link
Author

commented Sep 19, 2015

Is it possible to implement new CheckRedirectResp?

@rakyll

This comment has been minimized.

Copy link
Member

commented Sep 21, 2015

The canonical way to debug servers is to implement a RoundTripper that dumps the request and response. You can use httputil.DumpRequestOut and httputil.DumpResponse to dump the raw HTTP request and response.

http://golang.org/pkg/net/http/httputil/#DumpRequestOut
http://golang.org/pkg/net/http/httputil/#DumpResponse

@rakyll rakyll closed this Sep 21, 2015

@golang golang locked and limited conversation to collaborators Sep 22, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.