Fix: send {} body for POST, not None, v1.0.33

This commit is contained in:
2026-07-24 14:19:48 +04:00
parent 81e54e44d2
commit 72dd5ad5ae
3 changed files with 5 additions and 2 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ class HttpClient:
def post(self, path, data=None, **kwargs):
kwargs.setdefault("timeout", 30)
url = f"{self._endpoint}{path}"
r = self._session.post(url, json=data, **kwargs)
r = self._session.post(url, json=(data if data is not None else {}), **kwargs)
if not r.ok:
raise Exception(f"POST {path}: {r.status_code} {r.reason}: {r.text[:200]}")
result = {}