Returns the appropriate connection adapter for the given URL. :rtype: requests.adapters.BaseAdapter
(self, url: str)
| 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""" |