app/liteyuki/utils/network/__init__.py

16 lines
280 B
Python
Raw Normal View History

2024-05-25 12:09:54 +08:00
from aiohttp import ClientSession
async def simple_get(url: str) -> str:
"""
简单异步get请求
Args:
url:
Returns:
"""
async with ClientSession() as session:
async with session.get(url) as resp:
return await resp.text()