1 # http\Client\Response http\Client::getResponse([http\Client\Request $request = NULL])
3 Retrieve the corresponding reponse of an already finished request, or the last received response if $request is not set.
5 > **Note:** If $request is NULL, then the response is removed from the internal storage (stack-like operation).
9 * Optional http\Client\Request $request
10 The request to fetch the stored response for.
14 * http\Client\Response, the stored response for the request, or the last that was received.
15 * NULL, if no more response was available to pop, when no $request was given.
19 * http\Exception\InvalidArgumentException
20 * http\Exception\UnexpectedValueException
25 $client = new http\Client;
26 $client->enqueue(new http\Client\Request("GET", "http://php.net"));
27 $client->enqueue(new http\Client\Request("GET", "http://pecl.php.net"));
28 $client->enqueue(new http\Client\Request("GET", "http://pear.php.net"));
31 while ($res = $client->getResponse()) {
32 printf("%s returned %d\n", $res->getTransferInfo("effective_url"),
33 $res->getResponseCode());
38 http://php.net/ returned 200
39 http://pecl.php.net/ returned 200
40 http://pear.php.net/ returned 200