add clear
This commit is contained in:
@@ -482,7 +482,7 @@ class HttpClient
|
|||||||
if (is_array($body)) {
|
if (is_array($body)) {
|
||||||
return $body;
|
return $body;
|
||||||
}
|
}
|
||||||
$type = $data['Content-Type'] ?? $data['content-type'];
|
$type = $data['content-type'];
|
||||||
if (strpos($type, 'text/html') !== false) {
|
if (strpos($type, 'text/html') !== false) {
|
||||||
return $body;
|
return $body;
|
||||||
} else if (strpos($type, 'json') !== false) {
|
} else if (strpos($type, 'json') !== false) {
|
||||||
@@ -502,12 +502,10 @@ class HttpClient
|
|||||||
private function headerFormat($headers)
|
private function headerFormat($headers)
|
||||||
{
|
{
|
||||||
$_tmp = [];
|
$_tmp = [];
|
||||||
|
|
||||||
var_dump($headers);
|
|
||||||
foreach ($headers as $key => $val) {
|
foreach ($headers as $key => $val) {
|
||||||
$trim = explode(': ', trim($val));
|
$trim = explode(': ', trim($val));
|
||||||
|
|
||||||
$_tmp[$trim[0]] = $trim[1] ?? '';
|
$_tmp[strtolower($trim[0])] = $trim[1] ?? '';
|
||||||
}
|
}
|
||||||
var_dump($_tmp);
|
var_dump($_tmp);
|
||||||
return $_tmp;
|
return $_tmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user