mirror of
https://github.com/actix/actix-extras.git
synced 2024-11-24 16:02:59 +01:00
18 lines
477 B
Python
18 lines
477 B
Python
|
# This script could be used for actix-web multipart example test
|
||
|
# just start server and run client.py
|
||
|
|
||
|
import json
|
||
|
import asyncio
|
||
|
import aiohttp
|
||
|
|
||
|
async def req():
|
||
|
resp = await aiohttp.ClientSession().request(
|
||
|
"post", 'http://localhost:8080/',
|
||
|
data=json.dumps({"name": "Test user", "number": 100}),
|
||
|
headers={"content-type": "application/json"})
|
||
|
print(str(resp))
|
||
|
assert 200 == resp.status
|
||
|
|
||
|
|
||
|
asyncio.get_event_loop().run_until_complete(req())
|