python-dependency-injector/examples/miniapps/monitoring-daemon-asyncio/monitoringdaemon/http.py

12 lines
312 B
Python
Raw Normal View History

2020-08-05 20:11:45 +03:00
"""Http client module."""
from aiohttp import ClientSession, ClientResponse
class HttpClient:
async def request(self, method: str, url: str) -> ClientResponse:
async with ClientSession() as session:
async with session.request(method, url) as response:
return response