add clear
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user