Spaces:
Running
Running
File size: 566 Bytes
dacef8c |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
import aiohttp
async def async_post(url, data, headers):
async with aiohttp.ClientSession() as session:
async with session.post(url, data=data, headers=headers) as response:
response.raise_for_status() # Raise an exception for non-2xx status codes
return response
async def async_get(url, data, headers):
async with aiohttp.ClientSession() as session:
async with session.get(url) as response:
response.raise_for_status() # Raise an exception for non-2xx status codes
return response |