Extract instanceUid from Location header, v1.0.9

This commit is contained in:
2026-07-24 08:21:05 +04:00
parent d91b3cc446
commit f0639ff032
3 changed files with 14 additions and 3 deletions
+8 -2
View File
@@ -20,7 +20,13 @@ class HttpClient:
kwargs.setdefault("timeout", 30)
r = self._session.post(f"{self._endpoint}{path}", json=data, **kwargs)
r.raise_for_status()
result = {}
try:
return r.json()
result = r.json()
except Exception:
return {}
pass
# instanceUid приходит в Location (для create)
loc = r.headers.get("Location", "")
if loc:
result["_location"] = loc
return result