From 03573d1f053830746c1c1a46cf3d3f05bc4df92c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Sch=C3=A4fer?= Date: Tue, 18 May 2021 12:35:46 +0200 Subject: [PATCH] Explicitly pass mod_rest JSON as JSON Otherwise, it can get passed as x-www-form-urlencoded, which Prosody understandably does not quite like. --- snikket_web/prosodyclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/snikket_web/prosodyclient.py b/snikket_web/prosodyclient.py index dad3e59..c9c0644 100644 --- a/snikket_web/prosodyclient.py +++ b/snikket_web/prosodyclient.py @@ -511,7 +511,7 @@ class ProsodyClient: "to": self.session_address, } - async with session.post(self._rest_endpoint, data=req) as resp: + async with session.post(self._rest_endpoint, json=req) as resp: return resp.status == 200 @autosession @@ -524,7 +524,7 @@ class ProsodyClient: "to": domain, } - async with session.post(self._rest_endpoint, data=req) as resp: + async with session.post(self._rest_endpoint, json=req) as resp: if resp.status != 200: return "unknwn" try: