mirror of
https://github.com/kennethreitz/requests3.git
synced 2026-06-05 23:10:16 +00:00
25 lines
518 B
Python
25 lines
518 B
Python
# -*- coding: utf-8 -*-
|
|
|
|
"""
|
|
requests.utils
|
|
~~~~~~~~~~~~~~
|
|
|
|
This module provides utlity functions that are used within Requests
|
|
that are also useful for external consumption.
|
|
|
|
"""
|
|
|
|
|
|
def dict_from_cookiejar(cookiejar):
|
|
"""Returns a key/value dictoinary from a CookieJar."""
|
|
|
|
cookie_dict = {}
|
|
|
|
for _, cookies in cookiejar._cookies.items():
|
|
for _, cookies in cookies.items():
|
|
for cookie in cookies.values():
|
|
cookie_dict[cookie.name] = cookie.value
|
|
|
|
return cookie_dict
|
|
|