@@ -6,17 +6,24 @@ All notable changes to this project will be documented in this file, in reverse
66
77### Added
88
9- - [ #52 ] ( https://github.com/zendframework/zend-diactoros/pull/52 ) adds
10- ` Zend\Diactoros\Response\StringResponse ` , a factory class for generating
11- HTML or JSON responses. It contains the static methods:
12- - ` html($html, $status = 200, array $headers = []) `
13- - ` json($data, $status = 200, array $headers = []) `
14- - [ #58 ] ( https://github.com/zendframework/zend-diactoros/pull/58 ) adds
15- ` Zend\Diactoros\Response\EmptyResponse ` , a ` Zend\Diactoros\Response ` extension
16- for quickly creating empty, read-only responses.
17- - [ #59 ] ( https://github.com/zendframework/zend-diactoros/pull/59 ) adds
18- ` Zend\Diactoros\Response\RedirectResponse ` , a ` Zend\Diactoros\Response ` extension
19- for quickly creating redirect responses.
9+ - [ #52 ] ( https://github.com/zendframework/zend-diactoros/pull/52 ) ,
10+ [ #58 ] ( https://github.com/zendframework/zend-diactoros/pull/58 ) ,
11+ [ #59 ] ( https://github.com/zendframework/zend-diactoros/pull/59 ) , and
12+ [ #61 ] ( https://github.com/zendframework/zend-diactoros/pull/61 ) create several
13+ custom response types for simplifying response creation:
14+
15+ - ` Zend\Diactoros\Response\HtmlResponse ` accepts HTML content via its
16+ constructor, and sets the ` Content-Type ` to ` text/html ` .
17+ - ` Zend\Diactoros\Response\JsonResponse ` accepts data to serialize to JSON via
18+ its constructor, and sets the ` Content-Type ` to ` application/json ` .
19+ - ` Zend\Diactoros\Response\EmptyResponse ` allows creating empty, read-only
20+ responses, with a default status code of 204.
21+ - ` Zend\Diactoros\Response\RedirectResponse ` allows specifying a URI for the
22+ ` Location ` header in the constructor, with a default status code of 302.
23+
24+ Each also accepts an optional status code, and optional headers (which can
25+ also be used to provide an alternate ` Content-Type ` in the case of the HTML
26+ and JSON responses).
2027
2128### Deprecated
2229
0 commit comments