MCPcopy
hub / github.com/psf/requests / get_adapter

Method get_adapter

src/requests/sessions.py:870–881  ·  view source on GitHub ↗

Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter

(self, url: str)

Source from the content-addressed store, hash-verified

868 return {"proxies": proxies, "stream": stream, "verify": verify, "cert": cert}
869
870 def get_adapter(self, url: str) -> BaseAdapter:
871 """
872 Returns the appropriate connection adapter for the given URL.
873
874 :rtype: requests.adapters.BaseAdapter
875 """
876 for prefix, adapter in self.adapters.items():
877 if url.lower().startswith(prefix.lower()):
878 return adapter
879
880 # Nothing matches :-/
881 raise InvalidSchema(f"No connection adapters were found for {url!r}")
882
883 def close(self) -> None:
884 """Closes all adapters and as such the session"""

Calls 2

InvalidSchemaClass · 0.85
itemsMethod · 0.45