We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ad73ed1 commit 1328f92Copy full SHA for 1328f92
1 file changed
src/redfish/rest/v1.py
@@ -249,6 +249,10 @@ def text(self, value):
249
def dict(self):
250
"""Property for accessing the data as an dict"""
251
try:
252
+ if len(self.text) == 0:
253
+ # No response body; return empty dict instead to avoid exceptions
254
+ # No response bodies can be valid in many cases (especially 4XX and 5XX responses)
255
+ return {}
256
return json.loads(self.text)
257
except:
258
str = "Service responded with invalid JSON at URI {}\n{}".format(
0 commit comments