Home / Function/ __init__() — requests Function Reference

__init__() — requests Function Reference

Architecture documentation for the __init__() function in models.py from the requests codebase.

Entity Profile

Dependency Diagram

graph TD
  bcd33cc2_9f6b_9812_13af_21b2f3722d2f["__init__()"]
  c8cfcd0c_a36a_3124_6cd4_1516b06c63b3["PreparedRequest"]
  bcd33cc2_9f6b_9812_13af_21b2f3722d2f -->|defined in| c8cfcd0c_a36a_3124_6cd4_1516b06c63b3
  2254e69c_6485_b746_f87f_e79515085198["default_hooks()"]
  bcd33cc2_9f6b_9812_13af_21b2f3722d2f -->|calls| 2254e69c_6485_b746_f87f_e79515085198
  style bcd33cc2_9f6b_9812_13af_21b2f3722d2f fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/requests/models.py lines 336–351

    def __init__(self):
        #: HTTP verb to send to the server.
        self.method = None
        #: HTTP URL to send the request to.
        self.url = None
        #: dictionary of HTTP headers.
        self.headers = None
        # The `CookieJar` used to create the Cookie header will be stored here
        # after prepare_cookies is called
        self._cookies = None
        #: request body to send to the server.
        self.body = None
        #: dictionary of callback hooks, for internal usage.
        self.hooks = default_hooks()
        #: integer denoting starting position of a readable file-like body.
        self._body_position = None

Domain

Subdomains

Frequently Asked Questions

What does __init__() do?
__init__() is a function in the requests codebase, defined in src/requests/models.py.
Where is __init__() defined?
__init__() is defined in src/requests/models.py at line 336.
What does __init__() call?
__init__() calls 1 function(s): default_hooks.

Analyze Your Own Codebase

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

Try Supermodel Free