mirror of
https://github.com/kevin1024/vcrpy.git
synced 2025-12-09 01:03:24 +00:00
8 lines
286 B
Python
8 lines
286 B
Python
import asyncio
|
|
|
|
|
|
@asyncio.coroutine
|
|
def aiohttp_request(session, method, url, as_text, **kwargs):
|
|
response = yield from session.request(method, url, **kwargs) # NOQA: E999
|
|
return response, (yield from response.text()) if as_text else (yield from response.json()) # NOQA: E999
|