mirror of
https://github.com/fafhrd91/actix-web
synced 2024-11-24 08:22:59 +01:00
19 lines
417 B
Python
19 lines
417 B
Python
|
import asyncio
|
||
|
import aiohttp
|
||
|
|
||
|
|
||
|
def client():
|
||
|
with aiohttp.MultipartWriter() as writer:
|
||
|
writer.append('test')
|
||
|
writer.append_json({'passed': True})
|
||
|
|
||
|
resp = yield from aiohttp.request(
|
||
|
"post", 'http://localhost:8080/multipart',
|
||
|
data=writer, headers=writer.headers)
|
||
|
print(resp)
|
||
|
assert 200 == resp.status
|
||
|
|
||
|
|
||
|
loop = asyncio.get_event_loop()
|
||
|
loop.run_until_complete(client())
|