Skip to content

incomplete content #7225

Answered by Dreamsorcerer
newtester805 asked this question in Q&A
Feb 26, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

async with aiohttp.ClientSession

This is a context manager, handling the client session. When you exit that block, the session is closed.

By the second line of your main() function, both the request and the session have been closed. Therefore, it is not expected to be able to read from the response in the rest of the code.

Please see the quickstart and other examples for the correct way to make a request.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@Dreamsorcerer
Comment options

@newtester805
Comment options

Answer selected by newtester805
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants