mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-12-05 16:04:07 +03:00
12 lines
371 B
Python
12 lines
371 B
Python
|
"""Http client module."""
|
||
|
|
||
|
from aiohttp import ClientSession, ClientTimeout, ClientResponse
|
||
|
|
||
|
|
||
|
class HttpClient:
|
||
|
|
||
|
async def request(self, method: str, url: str, timeout: int) -> ClientResponse:
|
||
|
async with ClientSession(timeout=ClientTimeout(timeout)) as session:
|
||
|
async with session.request(method, url) as response:
|
||
|
return response
|