summaryrefslogtreecommitdiff
path: root/ATRI/utils/request.py
blob: 2cfce8522126c8334769c0490f0bfafc9e298f84 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import httpx
from ATRI.config import BotSelfConfig


proxy = BotSelfConfig.proxy
if not proxy:
    proxy = dict()


async def get(url: str, **kwargs):
    async with httpx.AsyncClient(proxies=proxy) as client:
        return await client.get(url, **kwargs)


async def post(url: str, **kwargs):
    async with httpx.AsyncClient(proxies=proxy) as client:
        return await client.post(url, **kwargs)