blob: 4e9a1ac003ed9f1137841cb6116a4a844f84bc30 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
from aiohttp import ClientSession
async def http_request(method="", url="", **kwargs):
async with ClientSession() as web:
res = await web.request(method, url, **kwargs)
return {
"status": res.status,
"headers": dict(res.headers),
"body": await res.text()
}
async def ping(**kwargs):
return "pong"
util_methods = {
"ping": ping,
"http_request": http_request
}
|