add clear

This commit is contained in:
as2252258@163.com
2020-01-03 11:38:53 +08:00
parent 72055c6591
commit 44dd66dc6b
+1 -3
View File
@@ -437,8 +437,6 @@ class HttpClient
if ($status != 200) {
return new Result(['code' => 500, 'message' => $body, 'header' => $header]);
}
var_dump($output);exit;
return $this->structure($this->resolve($header, $body), $data, $header);
} catch (\Exception $exception) {
return new Result(['code' => 500, 'message' => $exception->getMessage(), 'header' => []]);
@@ -468,7 +466,7 @@ class HttpClient
$type = $data['Content-Type'] ?? $data['content-type'];
if (strpos($type, 'json') !== false) {
return json_decode($body, true);
} else if (strpos($type, 'xml') !== false) {
} else if (strpos($type, 'xml') !== false || strpos($type, 'plain') !== false) {
$data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);
return json_decode(json_encode($data), TRUE);
} else if (strpos($type, 'plain') !== false) {