add clear

This commit is contained in:
2020-08-24 11:41:08 +08:00
parent 14bea139e9
commit b378d20826
+5 -6
View File
@@ -657,6 +657,11 @@ class HttpClient
curl_setopt($ch, CURLOPT_URL, $this->createRequestUrl($url, $data)); curl_setopt($ch, CURLOPT_URL, $this->createRequestUrl($url, $data));
curl_setopt($ch, CURLOPT_TIMEOUT, 120);// 超时设置 curl_setopt($ch, CURLOPT_TIMEOUT, 120);// 超时设置
curl_setopt($ch, CURLOPT_HEADER, true); curl_setopt($ch, CURLOPT_HEADER, true);
curl_setopt($ch, CURLOPT_NOBODY, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); // 超时设置
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);//返回内容
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// 跟踪重定向
// curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
if ($headers = $this->parseHeaderMat()) { if ($headers = $this->parseHeaderMat()) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
} }
@@ -669,12 +674,6 @@ class HttpClient
if (file_exists($key = $this->getSslKeyFile())) { if (file_exists($key = $this->getSslKeyFile())) {
curl_setopt($ch, CURLOPT_SSLKEY, $key); curl_setopt($ch, CURLOPT_SSLKEY, $key);
} }
curl_setopt($ch, CURLOPT_NOBODY, FALSE);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 1); // 超时设置
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);//返回内容
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);// 跟踪重定向
curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate');
if ($this->method == self::POST) { if ($this->method == self::POST) {
curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POST, 1);
} }