Fix: send {} body for POST, not None, v1.0.33
This commit is contained in:
@@ -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 = {}
|
||||
|
||||
Reference in New Issue
Block a user