alla cavallium enterprise gli standard non ci sono, bisogna mettere content-type in application/json

This commit is contained in:
andrew (from workstation) 2019-11-04 16:39:15 +01:00
parent 39e83a71b2
commit a76a369d91

View File

@ -93,8 +93,22 @@ class ChannelHistoryReadTask(AsyncTask):
message = await MessagePyrogram._parse(self.client, message, users, chats)
message = {"update_id": 1, "message": message}
data = json.dumps(message, default=JsonSerializer.default, ensure_ascii=True)
result = await self.http.post(self.webhook, data=bytes(data, "utf8"))
data = json.dumps(
message,
default=JsonSerializer.default,
ensure_ascii=True,
allow_nan=False,
check_circular=True,
sort_keys=False
)
result = await self.http.post(
self.webhook,
data=data,
headers=[
("Content-Type", "application/json")
]
)
await result.read()
result.close()