def test_POST_DATA_with_content_transfer_encoding(loop, test_client):
@asyncio.coroutine
def handler(request):
data = yield from request.post()
assert b'123' == data['name']
return web.Response()
app = web.Application()
app.router.add_post('/', handler)
client = yield from test_client(app)
form = FormData()
form.add_field('name', b'123',
content_transfer_encoding='base64')
resp = yield from client.post('/', data=form)
assert 200 == resp.status
评论列表
文章目录