mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 17:58:26 +08:00
🐛 fix missing json encode for cqhttp http
This commit is contained in:
parent
8e915f808b
commit
3571a5fdc0
@ -349,7 +349,7 @@ class Bot(BaseBot):
|
||||
elif not api_root.endswith("/"):
|
||||
api_root += "/"
|
||||
|
||||
headers = {}
|
||||
headers = {"Content-Type": "application/json"}
|
||||
if self.cqhttp_config.access_token is not None:
|
||||
headers[
|
||||
"Authorization"] = "Bearer " + self.cqhttp_config.access_token
|
||||
@ -358,7 +358,7 @@ class Bot(BaseBot):
|
||||
async with httpx.AsyncClient(headers=headers) as client:
|
||||
response = await client.post(
|
||||
api_root + api,
|
||||
json=data,
|
||||
content=json.dumps(data, cls=DataclassEncoder),
|
||||
timeout=self.config.api_timeout)
|
||||
|
||||
if 200 <= response.status_code < 300:
|
||||
|
Loading…
Reference in New Issue
Block a user