mirror of
https://github.com/ets-labs/python-dependency-injector.git
synced 2024-11-25 02:53:56 +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
|