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

Losing cookies when POST returns 302 #396

Closed
tversteeg opened this issue Dec 10, 2018 · 2 comments
Closed

Losing cookies when POST returns 302 #396

tversteeg opened this issue Dec 10, 2018 · 2 comments

Comments

@tversteeg
Copy link

When I call client.post() and I receive a 302 status the SET_COOKIE headers are gone. I know that these headers should be set because when I do the same thing in a browser I can see them.

I assume this has something to do with 302 being a redirection code, but is it possible to still extract these cookies?

@tversteeg
Copy link
Author

tversteeg commented Dec 10, 2018

I think I found a possible workaround by using a client builder with:

let client = reqwest::Client::builder()
    .redirect(reqwest::RedirectPolicy::None)
    .build()?

And then I manually check the location in the headers but it's not pretty.

@seanmonstar
Copy link
Owner

I do wish reqwest would provide support for this use case, see #14 to track this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants