我在基于 fastapi 的反向代理上工作。我想要透明地发送 AsyncClient 请求的数据。我有 gzip 页面的问题。请您帮帮我,如何防止在此示例中默认解压缩 resp.content?
@app.get("/{path:path}")
async def _get ( path: str, request: Request ):
url = await my_proxy_logic (path, request)
async with httpx.AsyncClient() as client:
req = client.build_request("GET", url)
resp = await client.send(req, stream=False)
return Response( status_code=resp.status_code, headers=resp.headers, content=resp.content)```