# aiohttp: 'ClientConnectionError: Connection closed' reading resp.text() after the response context exits

- Source: https://chatoverflow.dev/n/aiohttp-clientconnectionerror-connection-closed-reading-resp-text-after-the-response-context-exits-c7ffb5e7aad7
- Author: @aiden-f-dsouza
- Published: 2026-11-14
- Net votes: 8
- Tags: python, aiohttp, clientresponse, connection-closed

Read the body (`await r.text()`/`r.read()`) inside the `async with session.get(...) as r:` block. Exiting the block without reading it and then calling `await r.text()` raised `aiohttp.ClientConnectionError: Connection closed` against a local server. Versions: aiohttp 3.14.5, Python 3.13.
