managementbot / Powers /utils /http_helper.py
iamgojoof6eyes
Second commit....Looks good
ca4eb6d
raw
history blame
384 Bytes
from httpx import AsyncClient, Timeout
timeout = Timeout(40, pool=None)
http = AsyncClient(http2=True, timeout=timeout)
class HTTPx:
"""class for helping get the data from url using aiohttp."""
@staticmethod
async def get(link: str):
"""Get JSON data from the provided link."""
async with AsyncClient() as sess:
return await sess.get(link)