]> git.mxchange.org Git - friendica.git/blob - src/Capabilities/ICanCreateResponses.php
Inherit `ApiResponse` from `Response`
[friendica.git] / src / Capabilities / ICanCreateResponses.php
1 <?php
2
3 namespace Friendica\Capabilities;
4
5 use Friendica\Network\HTTPException\InternalServerErrorException;
6
7 interface ICanCreateResponses extends IRespondToRequests
8 {
9         /**
10          * Adds a header entry to the module response
11          *
12          * @param string $header
13          * @param string|null $key
14          */
15         public function setHeader(string $header, ?string $key = null): void;
16
17         /**
18          * Adds output content to the module response
19          *
20          * @param mixed $content
21          */
22         public function addContent($content): void;
23
24         /**
25          * Sets the response type of the current request
26          *
27          * @param string $type
28          * @param string|null $content_type (optional) overrides the direct content_type, otherwise set the default one
29          *
30          * @throws InternalServerErrorException
31          */
32         public function setType(string $type, ?string $content_type = null): void;
33 }