e14a7ad91afcddcf95b606c1ed3c77b4967265b4
[mdref/mdref-http] / http / Client / Request / __construct.md
1 # void http\Client\Request::__construct([string $meth = NULL[, string $url = NULL[, array $headers = NULL[, http\Message\Body $body = NULL]]]])
2
3 Create a new client request message to be enqueued and sent by http\Client.
4
5 ## Params:
6
7 * Optional string $meth = NULL
8 The request method.
9 * Optional string $url = NULL
10 The request URL.
11 * Optional array $headers = NULL
12 HTTP headers.
13 * Optional http\Message\Body $body = NULL
14 Request body.
15
16 ## Throws:
17
18 * http\Exception.
19
20 ## Example:
21
22 <?php
23 $request = new http\Client\Request("GET", "http://php.net/");
24 ?>