Добавлена функция для чистки параметров запроса

This commit is contained in:
2025-10-28 14:51:14 +03:00
parent 9ab9bcfc96
commit 45af5e247c
3 changed files with 8 additions and 3 deletions

View File

@ -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']