This commit is contained in:
as2252258@163.com
2021-08-04 02:49:04 +08:00
parent d82cd47c01
commit bb20446250
+2 -2
View File
@@ -70,7 +70,6 @@ class Response extends HttpService
public function toHtml($content): string public function toHtml($content): string
{ {
$this->format = self::HTML; $this->format = self::HTML;
var_dump($this->format);
return (string)$content; return (string)$content;
} }
@@ -142,6 +141,7 @@ class Response extends HttpService
*/ */
public function getResponseFormat(): string public function getResponseFormat(): string
{ {
var_dump($this->format);
if ($this->format == self::HTML) { if ($this->format == self::HTML) {
return 'text/html;charset=utf-8'; return 'text/html;charset=utf-8';
} else if ($this->format == self::XML) { } else if ($this->format == self::XML) {
@@ -173,8 +173,8 @@ class Response extends HttpService
*/ */
public function configure(SResponse $response = null): static public function configure(SResponse $response = null): static
{ {
var_dump($this->format);
$response->setStatusCode($this->statusCode); $response->setStatusCode($this->statusCode);
var_dump($this->getResponseFormat());
$response->header('Content-Type', $this->getResponseFormat()); $response->header('Content-Type', $this->getResponseFormat());
$response->header('Run-Time', $this->getRuntime()); $response->header('Run-Time', $this->getRuntime());
if (!empty($this->headers)) { if (!empty($this->headers)) {