big update's coming
[mdref/mdref-http] / http / Env / Response / __construct.md
1 # void http\Env\Response::__construct()
2
3 Create a new env response message instance.
4
5 ## Params:
6
7 None.
8
9 ## Throws:
10
11 * http\Exception\InvalidArgumentException
12 * http\Exception\UnexpectedValueException
13
14 ## Example:
15
16 <?php
17 $res = new http\Env\Response;
18 $res->setContentType("text/plain");
19 $res->getBody()->append("Hello world!\n");
20 $res->send(STDOUT);
21 ?>
22
23 Yields:
24
25 HTTP/1.1 200 OK
26 Accept-Ranges: bytes
27 Content-Type: text/plain
28 ETag: "b2a9e441"
29
30 Hello world!