@@ 9-17 (lines=9) @@ | ||
6 | ||
7 | use Furious\Psr7\Response; |
|
8 | ||
9 | class HtmlResponse extends Response |
|
10 | { |
|
11 | public function __construct(string $html, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) |
|
12 | { |
|
13 | parent::__construct($statusCode, $headers + [ |
|
14 | 'Content-Type' => 'text/html; charset=utf-8' |
|
15 | ], $html, $version, $reason); |
|
16 | } |
|
17 | } |
@@ 9-17 (lines=9) @@ | ||
6 | ||
7 | use Furious\Psr7\Response; |
|
8 | ||
9 | class TextResponse extends Response |
|
10 | { |
|
11 | public function __construct(string $text, int $statusCode = 200, array $headers = [], $body = null, string $version = '1.1', string $reason = null) |
|
12 | { |
|
13 | parent::__construct($statusCode, $headers + [ |
|
14 | 'Content-Type' => 'text/plain; charset=utf-8' |
|
15 | ], $text, $version, $reason); |
|
16 | } |
|
17 | } |