This commit is contained in:
2023-10-17 14:50:46 +08:00
parent 30da8e7b37
commit bfbdb1e7ce
12 changed files with 251 additions and 57 deletions
+13
View File
@@ -71,6 +71,19 @@ class ConstrictResponse extends Message implements ResponseInterface
}
/**
* @param string $content
* @param int $statusCode
* @param ContentType $contentType
* @return $this
*/
public function raw(string $content, int $statusCode = 200, ContentType $contentType = ContentType::JSON): static
{
$this->getBody()->write($content);
return $this->withContentType($contentType)->withStatus($statusCode);
}
/**
* @param string $content
* @param int $statusCode