Created
December 2, 2025 22:43
-
-
Save geospatial-jeff/5b0f84be794c5af0d5fbca301aa25409 to your computer and use it in GitHub Desktop.
aiohttp-without-context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import aiohttp | |
| import asyncio | |
| async def main(): | |
| try: | |
| client = aiohttp.ClientSession() | |
| try: | |
| resp = await client.get("https://www.google.com/") | |
| print(resp) | |
| resp.raise_for_status() | |
| b = await resp.read() | |
| finally: | |
| await resp.release() | |
| finally: | |
| await client.close() | |
| asyncio.run(main()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment