add clear
This commit is contained in:
@@ -695,7 +695,6 @@ class HttpClient
|
||||
if (!is_string($data)) {
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $this->mergeParams($data));
|
||||
} else {
|
||||
var_dump($data);
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
|
||||
}
|
||||
}
|
||||
@@ -785,7 +784,7 @@ class HttpClient
|
||||
if (is_array($body)) {
|
||||
return $body;
|
||||
}
|
||||
$type = $data['content-type'] ?? $data['Content-Type'] ?? 'text/html';
|
||||
$type = isset($data['content-type']) ? $data['content-type'] : (isset($data['Content-Type']) ? $data['Content-Type'] : 'text/html');
|
||||
if (strpos($type, 'text/html') !== false) {
|
||||
return $body;
|
||||
} else if (strpos($type, 'json') !== false) {
|
||||
|
||||
Reference in New Issue
Block a user