|
Post by rajppd on Apr 11, 2022 14:28:51 GMT
In my python code:
resp = REDFISH_OBJ.get("/redfish/v1/bmc", None) sys.stdout.write("%s\n" % response)
is able to print out on the console, whereas
resp = REDFISH_OBJ.get("/redfish/v1/bmc", None)
return JsonResponse(resp, safe=False)
throws up the error, Object of type RestResponse is not JSON serializable I used Django server for my application. Please advise how to get the Json response?
|
|
|
Post by mraineri on Apr 11, 2022 16:19:40 GMT
"resp" contains more than just the JSON response; it also contains the HTTP response code, headers, and other transactional information. If you just want to extract the JSON itself, then use "resp.dict".
|
|