()
| 8 | import aiohttp |
| 9 | |
| 10 | async 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 | |
| 20 | asyncio.get_event_loop().run_until_complete(req()) |