Home / Function/ get_adapter() — requests Function Reference

get_adapter() — requests Function Reference

Architecture documentation for the get_adapter() function in sessions.py from the requests codebase.

Function python CoreAPI VerbHandlers calls 1 called by 1

Entity Profile

Dependency Diagram

graph TD
  893b9da1_2923_c881_f9ef_c68d705ceea4["get_adapter()"]
  b4dad953_9227_8b3f_4041_3f8f1f9f0b29["Session"]
  893b9da1_2923_c881_f9ef_c68d705ceea4 -->|defined in| b4dad953_9227_8b3f_4041_3f8f1f9f0b29
  22824d7d_af0c_f593_6513_06ba28a4fc56["send()"]
  22824d7d_af0c_f593_6513_06ba28a4fc56 -->|calls| 893b9da1_2923_c881_f9ef_c68d705ceea4
  342c3122_113c_32a4_2286_94935f7ac0a8["items()"]
  893b9da1_2923_c881_f9ef_c68d705ceea4 -->|calls| 342c3122_113c_32a4_2286_94935f7ac0a8
  style 893b9da1_2923_c881_f9ef_c68d705ceea4 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

src/requests/sessions.py lines 782–793

    def get_adapter(self, url):
        """
        Returns the appropriate connection adapter for the given URL.

        :rtype: requests.adapters.BaseAdapter
        """
        for prefix, adapter in self.adapters.items():
            if url.lower().startswith(prefix.lower()):
                return adapter

        # Nothing matches :-/
        raise InvalidSchema(f"No connection adapters were found for {url!r}")

Domain

Subdomains

Calls

Called By

Frequently Asked Questions

What does get_adapter() do?
get_adapter() is a function in the requests codebase, defined in src/requests/sessions.py.
Where is get_adapter() defined?
get_adapter() is defined in src/requests/sessions.py at line 782.
What does get_adapter() call?
get_adapter() calls 1 function(s): items.
What calls get_adapter()?
get_adapter() is called by 1 function(s): send.

Analyze Your Own Codebase

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

Try Supermodel Free