Fix: r.json() returns string, check isinstance, v1.0.21

This commit is contained in:
2026-07-24 09:23:07 +04:00
parent 6f0b9c876f
commit 2ae1f5dd66
2 changed files with 4 additions and 3 deletions
+3 -2
View File
@@ -23,10 +23,11 @@ class HttpClient:
raise Exception(f"{r.status_code} {r.reason}: {r.text[:200]}")
result = {}
try:
result = r.json()
parsed = r.json()
if isinstance(parsed, dict):
result = parsed
except Exception:
pass
# instanceUid приходит в Location (для create)
loc = r.headers.get("Location", "")
if loc:
result["_location"] = loc