From 1a990644ff19f7c672b39d5452654268dfcba816 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mr=C2=B7x?= Date: Wed, 18 Nov 2020 14:33:59 +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 | 9 +++++++++ HttpServer/Client/IClient.php | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/HttpServer/Client/ClientAbstracts.php b/HttpServer/Client/ClientAbstracts.php index 9a21447f..257117ad 100644 --- a/HttpServer/Client/ClientAbstracts.php +++ b/HttpServer/Client/ClientAbstracts.php @@ -86,6 +86,15 @@ abstract class ClientAbstracts extends Component implements IClient } + /** + * @param string $contentType + */ + public function setContentType(string $contentType) + { + $this->header['Content-Type'] = $contentType; + } + + /** * @param string $path * @param array $params diff --git a/HttpServer/Client/IClient.php b/HttpServer/Client/IClient.php index 9029c188..3cd0d7f1 100644 --- a/HttpServer/Client/IClient.php +++ b/HttpServer/Client/IClient.php @@ -207,4 +207,9 @@ interface IClient public function setConnectTimeout(int $connect_timeout); + /** + * @param string $contentType + * @return mixed + */ + public function setContentType(string $contentType); }