diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index 8ee81fa4..c9a6de56 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -600,12 +600,7 @@ abstract class ClientAbstracts extends Component implements IClient } else if (strpos($type, 'xml') !== false) { return Help::xmlToArray($body); } else if (strpos($type, 'plain') !== false) { - if (!is_null($json = JSON::decode($body))) { - return $json; - } - if (!is_null($json = Help::toArray($body))) { - return $json; - } + return Help::toArray($body); } return $body; } diff --git a/HttpServer/Client/Curl.php b/HttpServer/Client/Curl.php index 932e9cff..2d1228c3 100644 --- a/HttpServer/Client/Curl.php +++ b/HttpServer/Client/Curl.php @@ -179,8 +179,6 @@ class Curl extends ClientAbstracts $status = (int)explode(' ', trim($header[0]))[1]; $header = $this->headerFormat($header); - var_dump($this->resolve($header, $body)); - return [$header, $this->resolve($header, $body), $status]; } diff --git a/System/Core/Help.php b/System/Core/Help.php index c75a80e4..93726901 100644 --- a/System/Core/Help.php +++ b/System/Core/Help.php @@ -38,13 +38,13 @@ class Help public static function toArray($xml) { if (empty($xml)) { - return []; + return null; } else if (is_array($xml)) { return $xml; } $xml = Xml::isXml($xml); if (!$xml) { - return []; + return static::jsonToArray($xml); } return $xml; }