blob: c399be0faa98a4f8c27c14c0bb8d6bc7fd617a69 (
plain)
1
2
3
4
5
6
7
8
9
10
|
from typing import Optional
from aiohttp.client import ClientSession
class Request():
async def get(self, url: str, headers: Optional[dict] = None) -> bytes:
async with ClientSession() as session:
async with session.get(url, headers=headers) as r:
result = await r.read()
return result
|