Spaces:
Paused
Paused
Download Powers/utils/http_helper.py from Dragdev/telegrambot: direct link, hf CLI and curl.
- Browser
- Download file 384 Bytes
-
https://huggingface.co/spaces/Dragdev/telegrambot/resolve/df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/http_helper.py
- Command line
-
hf download hf://spaces/Dragdev/telegrambot@df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/http_helper.py
-
curl -L -o http_helper.py https://huggingface.co/spaces/Dragdev/telegrambot/resolve/df6144993febe4688decfaa6700a97dfd70ca46f/Powers/utils/http_helper.py
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.""" | |
| async def get(link: str): | |
| """Get JSON data from the provided link.""" | |
| async with AsyncClient() as sess: | |
| return await sess.get(link) | |