Compatibility code to be able to use cookielib.CookieJar
with requests.
requests.utils imports from here, so be careful with imports.
Class | CookieConflictError |
There are two cookies that meet the criteria specified in the cookie jar. Use .get and .set and include domain and path args in order to be more specific. |
Class | RequestsCookieJar |
Compatibility class; is a cookielib.CookieJar, but exposes a dict interface. |
Function | cookiejar_from_dict |
Returns a CookieJar from a key/value dictionary. |
Class | MockRequest |
Wraps a requests.Request to mimic a urllib2.Request . |
Class | MockResponse |
Wraps a httplib.HTTPMessage to mimic a urllib.addinfourl . |
Function | _copy_cookie_jar |
Undocumented |
Function | create_cookie |
Make a cookie from underspecified parameters. |
Function | extract_cookies_to_jar |
Extract the cookies from the response into a CookieJar. |
Function | get_cookie_header |
Produce an appropriate Cookie header string to be sent with request , or None. |
Function | merge_cookies |
Add cookies to cookiejar and returns a merged CookieJar. |
Function | morsel_to_cookie |
Convert a Morsel object into a Cookie containing the one k/v pair. |
Function | remove_cookie_by_name |
Unsets a cookie by name, by default over all domains and paths. |
Parameters | |
cookie_dict | Dict of key/values to insert into CookieJar. |
cookiejar | (optional) A cookiejar to add the cookies to. |
overwrite | (optional) If False, will not replace cookies already in the jar with new ones. |
Returns | |
CookieJar | Undocumented |
Make a cookie from underspecified parameters.
By default, the pair of name
and value
will be set for the domain ''
and sent on every request (this is sometimes called a "supercookie").
Parameters | |
jar | cookielib.CookieJar (not necessarily a RequestsCookieJar) |
request | our own requests.Request object |
response | urllib3.HTTPResponse object |
request
, or None.Returns | |
str | Undocumented |