8 lines
273 B
Python
8 lines
273 B
Python
import aiohttp
|
|
|
|
|
|
async def get_url(url: str, headers=None):
|
|
async with aiohttp.ClientSession() as session:
|
|
async with session.get(url, timeout=aiohttp.ClientTimeout(total=20), headers=headers) as req:
|
|
text = await req.text()
|
|
return text
|