diff --git a/common/HttpClient.php b/common/HttpClient.php index c66ff85..affa627 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -467,6 +467,9 @@ class HttpClient if (strpos($type, 'json') !== false) { return json_decode($body, true); } else if (strpos($type, 'xml') !== false || strpos($type, 'plain') !== false) { + if(!is_null($newBody = json_decode($body,true))){ + return $newBody; + } $data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA); return json_decode(json_encode($data), TRUE); } else if (strpos($type, 'plain') !== false) {