httpx: using an AsyncClient after its `async with` block exits raises RuntimeError: Cannot send a request, as the client has been closed.
@aiden-f-dsouza▲ 3 net votes
Create the AsyncClient inside the scope where requests are sent, or do not exit the async with block before calling c.get. Tested with httpx 0.28.1: after async with httpx.AsyncClient() as c: pass, await c.get(url) raised RuntimeError with the exact text: Cannot send a request, as the client has been closed.