hydrotools._restclient.async_client module#

class hydrotools._restclient.async_client.ClientSession(base_url: str | ~yarl.URL | None = None, *, retry: bool = True, n_retries: int = 3, cache: ~aiohttp_client_cache.backends.base.CacheBackend | None = None, connector: ~aiohttp.connector.BaseConnector | None = None, loop: ~asyncio.events.AbstractEventLoop | None = None, cookies: ~typing.Mapping[str, str | BaseCookie[str] | Morsel[Any]] | ~typing.Iterable[~typing.Tuple[str, str | BaseCookie[str] | Morsel[Any]]] | BaseCookie[str] | None = None, headers: ~typing.Mapping[str | ~multidict._multidict.istr, str] | ~multidict._multidict.CIMultiDict | ~multidict._multidict.CIMultiDictProxy | None = None, skip_auto_headers: ~typing.Iterable[str] | None = None, auth: ~aiohttp.helpers.BasicAuth | None = None, json_serialize: ~typing.Callable[[~typing.Any], str] = <function dumps>, request_class: ~typing.Type[~aiohttp.client_reqrep.ClientRequest] = <class 'aiohttp.client_reqrep.ClientRequest'>, response_class: ~typing.Type[~aiohttp.client_reqrep.ClientResponse] = <class 'aiohttp.client_reqrep.ClientResponse'>, ws_response_class: ~typing.Type[~aiohttp.client_ws.ClientWebSocketResponse] = <class 'aiohttp.client_ws.ClientWebSocketResponse'>, version: ~aiohttp.http_writer.HttpVersion = HttpVersion(major=1, minor=1), cookie_jar: ~aiohttp.abc.AbstractCookieJar | None = None, connector_owner: bool = True, raise_for_status: bool | ~typing.Callable[[~aiohttp.client_reqrep.ClientResponse], ~typing.Awaitable[None]] = False, read_timeout: float | ~aiohttp.helpers._SENTINEL = _SENTINEL.sentinel, conn_timeout: float | None = None, timeout: object | ~aiohttp.client.ClientTimeout = _SENTINEL.sentinel, auto_decompress: bool = True, trust_env: bool = False, requote_redirect_url: bool = True, trace_configs: ~typing.List[~aiohttp.tracing.TraceConfig] | None = None, read_bufsize: int = 65536, max_line_size: int = 8190, max_field_size: int = 8190, fallback_charset_resolver: ~typing.Callable[[~aiohttp.client_reqrep.ClientResponse, bytes], str] = <function ClientSession.<lambda>>, **kwargs)#

Bases: CachedSession

async _request(method: str, str_or_url: str | URL, expire_after: None | int | float | str | datetime | timedelta = None, refresh: bool = False, *, params: Mapping[str, str] | None = None, data: Any = None, json: Any = None, cookies: Mapping[str, str | BaseCookie[str] | Morsel[Any]] | Iterable[Tuple[str, str | BaseCookie[str] | Morsel[Any]]] | BaseCookie[str] | None = None, headers: Mapping[str | istr, str] | CIMultiDict | CIMultiDictProxy | None = None, skip_auto_headers: Iterable[str] | None = None, auth: BasicAuth | None = None, allow_redirects: bool = True, max_redirects: int = 10, compress: str | None = None, chunked: bool | None = None, expect100: bool = False, raise_for_status: None | bool | Callable[[ClientResponse], Awaitable[None]] = None, read_until_eof: bool = True, proxy: str | URL | None = None, proxy_auth: BasicAuth | None = None, timeout: ClientTimeout | _SENTINEL = _SENTINEL.sentinel, verify_ssl: bool | None = None, fingerprint: bytes | None = None, ssl_context: None = None, ssl: None | bool | Fingerprint = True, server_hostname: str | None = None, proxy_headers: Mapping[str | istr, str] | CIMultiDict | CIMultiDictProxy | None = None, trace_request_ctx: SimpleNamespace | None = None, read_bufsize: int | None = None, auto_decompress: bool | None = None, max_line_size: int | None = None, max_field_size: int | None = None, **kwargs) ClientResponse | CachedResponse#

Wrapper around SessionClient._request() that adds caching

Args: