1
0
mirror of https://github.com/kevin1024/vcrpy.git synced 2025-12-09 01:03:24 +00:00

Add output option to use response.content stream

This commit is contained in:
Steinn Eldjárn Sigurðarson
2019-06-28 13:34:48 +00:00
parent 6c41b8b723
commit 67b03b45c3

View File

@@ -17,6 +17,8 @@ async def aiohttp_request(loop, method, url, output='text', encoding='utf-8', co
content = await response.json(encoding=encoding, content_type=content_type)
elif output == 'raw':
content = await response.read()
elif output == 'stream':
content = await response.content.read()
response_ctx._resp.close()
await session.close()