add clear

This commit is contained in:
2021-04-06 16:00:27 +08:00
parent 820132e5bc
commit 61a226bc0f
+1 -2
View File
@@ -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) {