Home / Function/ get_dict() — requests Function Reference

get_dict() — requests Function Reference

Architecture documentation for the get_dict() function in cookies.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  4e263186_5975_87b1_e8e4_1e296957469f["get_dict()"]
  12ccbc5f_4c31_987c_5272_7babba58a1f2["RequestsCookieJar"]
  4e263186_5975_87b1_e8e4_1e296957469f -->|defined in| 12ccbc5f_4c31_987c_5272_7babba58a1f2
  style 4e263186_5975_87b1_e8e4_1e296957469f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/requests/cookies.py lines 306–319

    def get_dict(self, domain=None, path=None):
        """Takes as an argument an optional domain and path and returns a plain
        old Python dict of name-value pairs of cookies that meet the
        requirements.

        :rtype: dict
        """
        dictionary = {}
        for cookie in iter(self):
            if (domain is None or cookie.domain == domain) and (
                path is None or cookie.path == path
            ):
                dictionary[cookie.name] = cookie.value
        return dictionary

Domain

Subdomains

Frequently Asked Questions

What does get_dict() do?
get_dict() is a function in the requests codebase, defined in src/requests/cookies.py.
Where is get_dict() defined?
get_dict() is defined in src/requests/cookies.py at line 306.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free