Explicitly pass mod_rest JSON as JSON

Otherwise, it can get passed as x-www-form-urlencoded, which
Prosody understandably does not quite like.
This commit is contained in:
Jonas Schäfer
2021-05-18 12:35:46 +02:00
parent 486596f89f
commit 03573d1f05

View File

@@ -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: