typos
[mdref/mdref-http] / http / Message / Body / __construct.md
1 # void http\Message\Body::__construct([resource $stream = NULL])
2
3 Create a new message body, optionally referencing $stream.
4
5 ## Params:
6
7 * Optional resource $stream = NULL
8 A stream to be used as message body.
9
10 ## Throws:
11
12 * http\Exception.
13
14 ## Example:
15
16 <?php
17 ob_end_clean();
18
19 $body = new http\Message\Body(fopen(__FILE__, "r"));
20 $resp = new http\Env\Response;
21 $resp->setContentType("text/plain");
22 $resp->setBody($body);
23 $resp->send();
24 ?>
25
26 Yields:
27
28 Accept-Ranges: bytes
29 X-Powered-By: PHP/5.5.5
30 Content-Type: text/plain
31 ETag: "138042e-527b5a0a-1b2"
32 Last-Modified: Thu, 07 Nov 2013 09:14:50 GMT
33
34 # void http\Message\Body::__construct([resource $stream = NULL])
35
36 Create a new message body, optionally referencing $stream.
37 ...