add clear
This commit is contained in:
@@ -478,9 +478,6 @@ class HttpClient
|
||||
$data = new Result(['code' => 500, 'message' => curl_error($ch)]);
|
||||
} else {
|
||||
[$header, $body, $status] = $this->explode($output);
|
||||
|
||||
var_dump($header, $body, $status);exit;
|
||||
|
||||
if ($status != 200) {
|
||||
$data = new Result(['code' => 500, 'message' => $body, 'header' => $header]);
|
||||
} else {
|
||||
@@ -542,11 +539,14 @@ class HttpClient
|
||||
$type = $data['content-type'];
|
||||
if (strpos($type, 'text/html') !== false) {
|
||||
return $body;
|
||||
} else if (strpos($type, 'json') !== false) {
|
||||
}
|
||||
if (strpos($type, 'json') !== false) {
|
||||
return Help::toArray($body);
|
||||
} else if (strpos($type, 'xml') !== false) {
|
||||
}
|
||||
if (strpos($type, 'xml') !== false) {
|
||||
return Help::toArray($body);
|
||||
} else if (strpos($type, 'plain') !== false) {
|
||||
}
|
||||
if (strpos($type, 'plain') !== false) {
|
||||
return Help::toArray($body);
|
||||
}
|
||||
return $body;
|
||||
|
||||
Reference in New Issue
Block a user