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 response was found.
20 $client = new http\Client;
21 $client->enqueue(new http\Client\Request("GET", "http://php.net"));
22 $client->enqueue(new http\Client\Request("GET", "http://pecl.php.net"));
23 $client->enqueue(new http\Client\Request("GET", "http://pear.php.net"));
26 while ($res = $client->getResponse()) {
27 printf("%s returned %d\n", $res->getTransferInfo("effective_url"),
28 $res->getResponseCode());
33 http://php.net/ returned 200
34 http://pecl.php.net/ returned 200
35 http://pear.php.net/ returned 200