diff --git a/common/HttpClient.php b/common/HttpClient.php index affa627..0723cbd 100644 --- a/common/HttpClient.php +++ b/common/HttpClient.php @@ -463,11 +463,14 @@ class HttpClient */ private function resolve($data, $body) { + if (is_array($body)) { + return $body; + } $type = $data['Content-Type'] ?? $data['content-type']; 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))){ + if (!is_null($newBody = json_decode($body, true))) { return $newBody; } $data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);