Skip to content

EspoCRM – Open Source CRM Application

Get content type method

Yurii2454e90a2d02
diff --git a/application/Espo/Core/Api/Request.php b/application/Espo/Core/Api/Request.php
index 5149866a10..4b58419bfc 100644
--- a/application/Espo/Core/Api/Request.php
+++ b/application/Espo/Core/Api/Request.php
@@ -127,6 +127,13 @@ interface Request
*/
public function getServerParam(string $name);
+ /**
+ * Get the content type.
+ *
+ * @since 10.1.0
+ */
+ public function getContentType(): ?string;
+
/**
* Get the PSR-7 request.
*
diff --git a/application/Espo/Core/Api/RequestNull.php b/application/Espo/Core/Api/RequestNull.php
index d922450c8a..0ad1d40cec 100644
--- a/application/Espo/Core/Api/RequestNull.php
+++ b/application/Espo/Core/Api/RequestNull.php
@@ -134,6 +134,11 @@ class RequestNull implements ApiRequest
return null;
}
+ public function getContentType(): ?string
+ {
+ return null;
+ }
+
public function toPsr7(): Psr7Request
{
$request = (new RequestFactory())->createRequest(Method::GET, "http://localhost");