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
http client POST/GET.. will not save cookie before do redirect request #27596
Comments
I think this is the bug of http client Do method, when it do redirect in client, it should put the cookie get from response to the request to do next request. |
You have mentioned about a redirect request in the title. However, I do not see any redirects here. You are just doing a POST request and printing the response headers. Can you clarify that ? Also, please post an output of Also, please see this - https://golang.org/pkg/net/http/#Client
Maybe relevant to your case. |
You can see that I only do the POST /login and the later is execute by http client implementation. From my point of view, I think the
|
Code I am use to testing
|
This maybe just a hunch, but looks like you need to have a non-nil jar for it to copy cookies from the response.
|
@qianguozheng have you tried asking on an online forum like golang-nuts? Those are better places to ask questions and giving your code for others to debug, as we use the issue tracker for bugs and proposals. See https://github.com/golang/go/wiki/Questions. |
Please answer these questions before submitting your issue. Thanks!
What version of Go are you using (
go version
)?go version go1.10.3 linux/amd64
Does this issue reproduce with the latest release?
Yes
What operating system and processor architecture are you using (
go env
)?What did you do?
Simply do http POST request, I want to login with http client to the server
https://github.com/qianguozheng/goadmin.git
, but it not work out.If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
What did you expect to see?
the cookie in response
What did you see instead?
no cookie in response
The text was updated successfully, but these errors were encountered: