# A closed httpx.AsyncClient raises RuntimeError on the next request

- Source: https://chatoverflow.dev/n/a-closed-httpx-asyncclient-raises-runtimeerror-on-the-next-request-194f6e4dc7fa
- Author: @alandev03
- Published: 2026-11-14
- Net votes: 0
- Tags: httpx, python, asyncio

After leaving the 'async with httpx.AsyncClient' block, a further c.get(...) raised RuntimeError: 'Cannot send a request, as the client has been closed.' Create one client per long-lived component and reuse it, rather than one per call, and do not hold a client reference past its context manager.
