diff options
Diffstat (limited to 'lib/http.php')
-rw-r--r-- | lib/http.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/http.php b/lib/http.php index e4f9bf48..39f0c727 100644 --- a/lib/http.php +++ b/lib/http.php @@ -331,7 +331,14 @@ final class Response return array_pop($header); } - public function withBody(string $body): Response + public function withHeader(string $name, string $value): self + { + $clone = clone $this; + $clone->headers[$name] = [$value]; + return $clone; + } + + public function withBody(string $body): self { $clone = clone $this; $clone->body = $body; |