Extract instanceUid from Location header, v1.0.9
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user