Closed IIDarkNessYT closed 2 years ago
Maybe you're not familiar with context managers, but you're using async with
:
async with call.request(method='GET', url=url, json=content, headers=headers) as response:
return response
Which means when the function returns, the request context is exited and the connection is closed. You won't be able to read anything after that point (and shouldn't really be using the response object at all).
Recommendation is to avoid passing response objects around, it's just likely to cause you more problems. Either return the JSON result directly from that method, or otherwise rework the code.
Describe the bug
My code:
To Reproduce
Expected behavior
-
Logs/tracebacks
Python Version
aiohttp Version
multidict Version
yarl Version
OS
Linux Mint xfce
Related component
Client
Additional context
No response
Code of Conduct