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); }