Fix: r.json() returns string, check isinstance, v1.0.21
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user