mdref.json config
[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\InvalidArgumentException
19 * http\Exception\UnexpectedValueException
20
21 ## Example:
22
23 <?php
24 $request = new http\Client\Request("GET", "http://php.net/");
25 ?>