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); +// } /**