Добавлена функция для чистки параметров запроса
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
from collections.abc import Callable, Mapping
|
||||
from logging import getLogger
|
||||
from ssl import SSLContext
|
||||
from typing import Any
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from httpx import URL, Limits
|
||||
from httpx import AsyncClient as AsyncHTTPXClient
|
||||
@ -10,6 +10,8 @@ from httpx import _types as t # type: ignore
|
||||
|
||||
from aiohttpx.transports.cache import AsyncCacheTransport
|
||||
|
||||
K = TypeVar('K')
|
||||
|
||||
|
||||
class AioHTTPXClient(AsyncHTTPXClient):
|
||||
def __init__(
|
||||
@ -59,5 +61,8 @@ class AioHTTPXClient(AsyncHTTPXClient):
|
||||
|
||||
self.logger = getLogger(logger)
|
||||
|
||||
def clean_dict[K, V](self, params: dict[K, Any | None]):
|
||||
return {k: v for k, v in params.items() if v is not None}
|
||||
|
||||
|
||||
__all__ = ['AioHTTPXClient']
|
||||
|
||||
Reference in New Issue
Block a user