Skip to content

Instantly share code, notes, and snippets.

@geospatial-jeff
Created December 2, 2025 22:43
Show Gist options
  • Select an option

  • Save geospatial-jeff/5b0f84be794c5af0d5fbca301aa25409 to your computer and use it in GitHub Desktop.

Select an option

Save geospatial-jeff/5b0f84be794c5af0d5fbca301aa25409 to your computer and use it in GitHub Desktop.
aiohttp-without-context
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