3 namespace Friendica\Capabilities;
5 use Friendica\Network\HTTPException\InternalServerErrorException;
6 use Psr\Http\Message\ResponseInterface;
8 interface ICanCreateResponses
10 const TYPE_HTML = 'html';
11 const TYPE_XML = 'xml';
12 const TYPE_JSON = 'json';
13 const TYPE_ATOM = 'atom';
14 const TYPE_RSS = 'rss';
16 const ALLOWED_TYPES = [
25 * Adds a header entry to the module response
27 * @param string $header
28 * @param string|null $key
30 public function setHeader(string $header, ?string $key = null): void;
33 * Adds output content to the module response
35 * @param mixed $content
37 public function addContent($content): void;
40 * Sets the response type of the current request
43 * @param string|null $content_type (optional) overrides the direct content_type, otherwise set the default one
45 * @throws InternalServerErrorException
47 public function setType(string $type, ?string $content_type = null): void;
50 * Creates a PSR-7 compliant interface
51 * @see https://www.php-fig.org/psr/psr-7/
53 * @return ResponseInterface
55 public function generate(): ResponseInterface;