diff --git a/src/redfish/rest/v1.py b/src/redfish/rest/v1.py index 200f7ef..e000930 100644 --- a/src/redfish/rest/v1.py +++ b/src/redfish/rest/v1.py @@ -950,12 +950,16 @@ def _rest_request(self, path, method='GET', args=None, body=None, headerstr += '\t' + header[0] + ': ' + header[1] + '\n' try: + try: + restrespstr = json.dumps(json.loads(restresp.read), indent=4) + except: + restrespstr = restresp.read LOGGER.debug('HTTP RESPONSE for %s:\nCode: %s\n\nHeaders:\n' \ - '%s\nBody Response of %s: %s\n'%\ + '%s\nBody Response of %s:\n%s\n'%\ (restresp.request.path, str(restresp._http_response.status_code)+ ' ' + \ restresp._http_response.reason, - headerstr, restresp.request.path, restresp.read)) + headerstr, restresp.request.path, restrespstr)) except: LOGGER.debug('HTTP RESPONSE:\nCode:%s', restresp) else: