(
self, url, timeout=None, connection_timeout=None, max_retries=None, headers=None, auth_method=None, **kwargs
)
| 50 | } |
| 51 | |
| 52 | def __init__( |
| 53 | self, url, timeout=None, connection_timeout=None, max_retries=None, headers=None, auth_method=None, **kwargs |
| 54 | ): |
| 55 | self._url = url |
| 56 | self._timeout = timeout or TIMEOUT_DEFAULT |
| 57 | self._connection_timeout = connection_timeout or CONNECTION_TIMEOUT |
| 58 | self._headers = headers or {} |
| 59 | self._auth_method = auth_method |
| 60 | |
| 61 | # TODO basic auth parameters must be required for auth_method == 'basic' |
| 62 | self._basic_auth = (kwargs.get('basic_auth_user'), kwargs.get('basic_auth_pass')) |
| 63 | |
| 64 | self._max_retries = max_retries or self.MAX_RETRIES |
| 65 | self._sessions = {self._session_key(): self.create_session()} |
| 66 | |
| 67 | def create_session(self): |
| 68 | session = requests.Session() |
nothing calls this directly
no test coverage detected