big update's coming
[mdref/mdref-http] / http / Client / Request / setQuery.md
1 # http\Client\Request http\Client\Request::setQuery([mixed $query_data = NULL])
2
3 (Re)set the querystring.
4 See http\Client\Request::addQuery() and http\Message::setRequestUrl().
5
6 ## Params:
7
8 * mixed $query_data, new querystring data.
9
10 ## Returns:
11
12 * http\Client\Request, self.
13
14 ## Throws:
15
16 * http\Exception\InvalidArgumentException
17 * http\Exception\BadQueryStringException
18
19 ## Example:
20
21 <?php
22 $q = new http\QueryString("foo=bar&bar=foo");
23 $r = new http\Client\Request;
24 $r->setQuery($q);
25 var_dump($r->getRequestUrl());
26 ?>
27
28 Yields:
29
30 string(33) "http://localhost/?foo=bar&bar=foo"