Skip to content

Commit

Permalink
fix: 针对content-type没设置json的时候,修复问题
Browse files Browse the repository at this point in the history
  • Loading branch information
wuranxu committed May 29, 2024
1 parent 13634ce commit d5ae82e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/middleware/AsyncHttpClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit d5ae82e

Please sign in to comment.