add clear

This commit is contained in:
as2252258@163.com
2020-01-03 15:15:00 +08:00
parent 0417e76c26
commit 2ab9714f96
+2 -4
View File
@@ -482,7 +482,7 @@ class HttpClient
if (is_array($body)) {
return $body;
}
$type = $data['Content-Type'] ?? $data['content-type'];
$type = $data['content-type'];
if (strpos($type, 'text/html') !== false) {
return $body;
} else if (strpos($type, 'json') !== false) {
@@ -502,12 +502,10 @@ class HttpClient
private function headerFormat($headers)
{
$_tmp = [];
var_dump($headers);
foreach ($headers as $key => $val) {
$trim = explode(': ', trim($val));
$_tmp[$trim[0]] = $trim[1] ?? '';
$_tmp[strtolower($trim[0])] = $trim[1] ?? '';
}
var_dump($_tmp);
return $_tmp;