resp = await aiohttp.request('GET', 'http://flupy.org/data/flags/cn/cn.gif')
D:\Continuum\anaconda3\lib\site-packages\ipykernel_launcher.py:4: RuntimeWarning: coroutine 'ClientSession._request' was never awaited
after removing the cwd from sys.path.
RuntimeWarning: Enable tracemalloc to get the object allocation traceback
Unclosed client session
client_session: <aiohttp.client.ClientSession object at 0x0000000008F0B048>
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-30-35d97f3baca0> in async-def-wrapper()
TypeError: object _SessionRequestContextManager can't be used in 'await' expression
Get the URL
TypeError
Everytime
Anaconda 3, Python 3.7.3 aiohttp 3.6.0
It deliberately can not.
Please use async with aiohttp.request('GET', 'http://flupy.org/data/flags/cn/cn.gif') as resp: ... to explicitly control the response lifecycle.
Most helpful comment
It deliberately can not.
Please use
async with aiohttp.request('GET', 'http://flupy.org/data/flags/cn/cn.gif') as resp: ...to explicitly control the response lifecycle.