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

Cookie support? #1

Closed
keul opened this issue Feb 14, 2011 · 4 comments
Closed

Cookie support? #1

keul opened this issue Feb 14, 2011 · 4 comments

Comments

@keul
Copy link

keul commented Feb 14, 2011

An feature request (not found in documentation).

Does this support cookies?

Usecase: I can integrate this module inside an existings framework. This framework generate for me the authentication/session cookie, so to perform request using requests there I need to add the same auth cookie already generated.

@kennethreitz
Copy link
Contributor

It does not yet, but I am planning on adding that in to the next release.

It's just a matter of keeping the api as elegant as possible. What would you find appropriate? Just having a cookies list you can pass in (and build the cookies it yourself externally)?

@keul
Copy link
Author

keul commented Feb 14, 2011

Looking at the minimalistic approach of this library (that I think is what users will like ofit) I think that adding only a feature for adding a list of cookie is enough!

@kennethreitz
Copy link
Contributor

My thoughts exactly.

Plan is to have an optional cookiejar paramater to the requests. You can then add your cookielib.CookieJar object there, and that will be passed along with the request.

@kennethreitz
Copy link
Contributor

v0.2.2 was just released, which adds support for CookieJars. Thanks!

jar = cookielib.CookieJar()
#stuff w/ jar

requests.get('url', cookies=jar)

Lukasa pushed a commit that referenced this issue Mar 16, 2015
kennethreitz pushed a commit that referenced this issue Aug 17, 2016
Updating fork with updates from original repo
nateprewitt pushed a commit that referenced this issue Oct 30, 2018
Syncing fork to the original repository
frostming pushed a commit that referenced this issue May 16, 2019
Updating my fork with the original
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 1, 2021
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants