MCPcopy Create free account
hub / github.com/actix/examples / req

Function req

json/json/client.py:10–17  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8import aiohttp
9
10async def req():
11 resp = await aiohttp.ClientSession().request(
12 "post", 'http://localhost:8080/',
13 data=json.dumps({"name": "Test user", "number": 100}),
14 headers={"content-type": "application/json"})
15 print(str(resp))
16 print(await resp.text())
17 assert 200 == resp.status
18
19
20asyncio.get_event_loop().run_until_complete(req())

Callers 1

client.pyFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected