From 80a2116cf1e954f46e54526cbdd46222060601ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 14:43:51 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HttpServer/Client/ClientAbstracts.php | 2 +- HttpServer/Client/Curl.php | 44 +++++++++++++-------------- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index 924f4b8c..cfc39dbe 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -159,7 +159,7 @@ abstract class ClientAbstracts extends Component implements IClient */ public function upload(string $path, array $params = []) { - return $this->request(self::POST, $path, $params); + return $this->request(self::UPLOAD, $path, $params); } diff --git a/HttpServer/Client/Curl.php b/HttpServer/Client/Curl.php index 6f8221b1..84ab850a 100644 --- a/HttpServer/Client/Curl.php +++ b/HttpServer/Client/Curl.php @@ -55,28 +55,28 @@ class Curl extends ClientAbstracts return $resource; } - - /** - * @param $path - * @param $params - * @return mixed|resource - * @throws Exception - */ - public function upload($path, $params = []) - { - [$host, $isHttps, $path] = $this->matchHost($path); - - $host = $isHttps ? 'https://' . $host : 'http://' . $host; - - $resource = $this->do(curl_init($host . $path), $host . $path, self::POST); - - curl_setopt($resource, CURLOPT_POSTFIELDS, $params); - - if ($isHttps !== false) { - return $this->execute($this->curlHandlerSslSet($resource)); - } - return $this->execute($resource); - } +// +// /** +// * @param $path +// * @param $params +// * @return mixed|resource +// * @throws Exception +// */ +// public function upload($path, $params = []) +// { +// [$host, $isHttps, $path] = $this->matchHost($path); +// +// $host = $isHttps ? 'https://' . $host : 'http://' . $host; +// +// $resource = $this->do(curl_init($host . $path), $host . $path, self::POST); +// +// curl_setopt($resource, CURLOPT_POSTFIELDS, $params); +// +// if ($isHttps !== false) { +// return $this->execute($this->curlHandlerSslSet($resource)); +// } +// return $this->execute($resource); +// } /**