add clear

This commit is contained in:
2020-05-27 16:17:21 +08:00
parent 6f2852ecbf
commit 1b9b6c4af6
+3 -6
View File
@@ -213,7 +213,7 @@ class HttpClient
*/
public function setHeader($key, $value)
{
$this->header[strtoupper($key)] = $value;
$this->header[$key] = $value;
}
/**
@@ -222,7 +222,7 @@ class HttpClient
*/
public function addHeader($key, $value)
{
$this->header[strtoupper($key)] = $value;
$this->header[$key] = $value;
}
/**
@@ -504,9 +504,6 @@ class HttpClient
if (!empty($this->header)) {
$client->setHeaders($this->header);
}
var_dump($this->header);
$client->setMethod(strtoupper($this->method));
if (strtolower($this->method) == self::GET && !empty($data)) {
$url .= '?' . $data;
@@ -950,7 +947,7 @@ class HttpClient
return [];
}
foreach ($headers as $key => $val) {
$this->header[strtoupper($key)] = $val;
$this->header[$key] = $val;
}
return $this->header;
}