找出异步 HTTPX 客户端里的 bug

来自 HTTPX 客户端
HTTPX 0.28.1 / Python 3.14 进阶 4分钟 找出 2处问题

这个函数应在服务中复用异步 I/O。找出两个客户端边界错误。

Python
import httpx

async def load_order(order_id: int) -> dict:
    async with httpx.AsyncClient() as client:
        response = client.get(
            f"https://inventory.test/orders/{order_id}"
        )
    return response.json()
在试验场中打开
报告错误