4in1_ws_web/src/engine/http/PlainTextResponse.php
2025-04-28 14:47:25 +03:00

20 lines
414 B
PHP

<?php
namespace engine\http;
class PlainTextResponse
extends Response
{
public function __construct(string $text, HTTPCode $code = HTTPCode::OK) {
parent::__construct($code);
$this->data = $text;
}
public function getBody(): string {
return $this->data;
}
public function getHeaders(): ?array {
return ['Content-Type: text/plain; charset=utf-8'];
}
}