-
-
Notifications
You must be signed in to change notification settings - Fork 845
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
Add persistent cookies option to Client #3065
base: master
Are you sure you want to change the base?
Conversation
Happy to change argument name in api implementation. For tests, not explicitly testing the persistence as True option, but the existing persistence test fails if default set to False (as expected). Also not directly testing AsyncClient, but that is true for other cookie tests as well. |
Cool, the issue just came to me too. I think the naming convention here would be Can you add an override parameter to all request methods (request, send, get, post, etc...), with the default value
There's a deprecation warning about cookie persistence in |
Just a thought, doesn't persistence suggest that cookies survive the client itself? Like storing to a file? |
Yeah, can make all those changes. For the persistence on test, there is an existing one explicitly about persistence (named
Would it be better to explicitly add the parameter value to True, leave as default, or do both in different tests? For the deprecation warning:
This should be removed? I'm not sure we fully remove the ambiguity referenced here, as this doesn't affect what happens when cookies are set at the request level. I might be misreading the intention behind this warning (although I would definitely note that reading this solidifies my agreement that something like |
Just have a look how
You're right, that deprecation warning is related to keeping cookies on redirect, nothing to do with your patch. One more reason not to call this one persist_cookies :) |
…cookie-persistence-option
#3071 Given that cookie params are being removed from the request methods (following the deprecation warning noted above), should this option also only exist at the client level? |
I'm alright with the code, but it probably should be mentioned somewhere in the documentation. I'm looking at WDYT @tomchristie ? |
Come to think about it, even if per-request cookies were removed, it still made sense to include this feature. |
…cookie-persistence-option-override # Conflicts: # httpx/_client.py
I added an internal pull request with all the method overrides. It's a bit on the big/boring side because of all the public methods available. I can merge if it looks good. Not sure on documentation. It might be an esoteric enough option that for now the client docstrings might be enough? I can take a shot if new section is warranted, or probably defer to someone more familiar with the documentation style for httpx. |
add method override for merging response cookies
Summary
Closes #2992
Checklist