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
Closed

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

kayrus opened this issue Sep 19, 2015 · 3 comments

Comments

@kayrus
Copy link

kayrus 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
Copy link
Member

minux commented Sep 19, 2015 via email

@kayrus
Copy link
Author

kayrus commented Sep 19, 2015

Is it possible to implement new CheckRedirectResp?

@rakyll
Copy link
Contributor

rakyll 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 as completed 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.
Projects
None yet
Development

No branches or pull requests

4 participants