From d5ae82eab54c4e00b7c1cc309dc5a8e4c9124c2e Mon Sep 17 00:00:00 2001 From: "rx.wu" Date: Wed, 29 May 2024 18:15:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E9=92=88=E5=AF=B9content-type=E6=B2=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AEjson=E7=9A=84=E6=97=B6=E5=80=99=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/middleware/AsyncHttpClient.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/middleware/AsyncHttpClient.py b/app/middleware/AsyncHttpClient.py index 25dc2fc7..470e794a 100755 --- a/app/middleware/AsyncHttpClient.py +++ b/app/middleware/AsyncHttpClient.py @@ -97,7 +97,8 @@ async def client(url: str, body_type: BodyType = BodyType.json, timeout=15, **kw @staticmethod async def get_resp(resp): try: - data = await resp.json(encoding='utf-8') + data = await resp.text() + data = json.loads(data) # 说明是json格式 # return json.dumps(data, ensure_ascii=False, indent=4), True except: