add clear
This commit is contained in:
@@ -437,8 +437,6 @@ class HttpClient
|
|||||||
if ($status != 200) {
|
if ($status != 200) {
|
||||||
return new Result(['code' => 500, 'message' => $body, 'header' => $header]);
|
return new Result(['code' => 500, 'message' => $body, 'header' => $header]);
|
||||||
}
|
}
|
||||||
|
|
||||||
var_dump($output);exit;
|
|
||||||
return $this->structure($this->resolve($header, $body), $data, $header);
|
return $this->structure($this->resolve($header, $body), $data, $header);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return new Result(['code' => 500, 'message' => $exception->getMessage(), 'header' => []]);
|
return new Result(['code' => 500, 'message' => $exception->getMessage(), 'header' => []]);
|
||||||
@@ -468,7 +466,7 @@ class HttpClient
|
|||||||
$type = $data['Content-Type'] ?? $data['content-type'];
|
$type = $data['Content-Type'] ?? $data['content-type'];
|
||||||
if (strpos($type, 'json') !== false) {
|
if (strpos($type, 'json') !== false) {
|
||||||
return json_decode($body, true);
|
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);
|
$data = simplexml_load_string($body, 'SimpleXMLElement', LIBXML_NOCDATA);
|
||||||
return json_decode(json_encode($data), TRUE);
|
return json_decode(json_encode($data), TRUE);
|
||||||
} else if (strpos($type, 'plain') !== false) {
|
} else if (strpos($type, 'plain') !== false) {
|
||||||
|
|||||||
Reference in New Issue
Block a user