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) 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) public function addHeader($key, $value)
{ {
$this->header[strtoupper($key)] = $value; $this->header[$key] = $value;
} }
/** /**
@@ -504,9 +504,6 @@ class HttpClient
if (!empty($this->header)) { if (!empty($this->header)) {
$client->setHeaders($this->header); $client->setHeaders($this->header);
} }
var_dump($this->header);
$client->setMethod(strtoupper($this->method)); $client->setMethod(strtoupper($this->method));
if (strtolower($this->method) == self::GET && !empty($data)) { if (strtolower($this->method) == self::GET && !empty($data)) {
$url .= '?' . $data; $url .= '?' . $data;
@@ -950,7 +947,7 @@ class HttpClient
return []; return [];
} }
foreach ($headers as $key => $val) { foreach ($headers as $key => $val) {
$this->header[strtoupper($key)] = $val; $this->header[$key] = $val;
} }
return $this->header; return $this->header;
} }