1 # http\Client http\Client::enqueue(http\Client\Request $request[, callable $cb])
3 Add another http\Client\Request to the request queue.
4 If the optional callback $cb returns true, the request will be automatically dequeued.
6 See http\Client::dequeue() and http\Client::send().
10 * http\Client\Request $request
11 The request to enqueue.
12 * Optional callable $cb
13 A callback to automatically call when the request has finished.
21 * http\Exception\InvalidArgumentException
22 * http\Exception\BadMethodCallException
23 * http\Exception\RuntimeException
27 (new http\Client)->enqueue(new http\Client\Request("GET", "http://php.net"),
28 function(http\Client\Response $res) {
29 printf("%s returned %d\n", $res->getTransferInfo("effective_url"), $res->getResponseCode());
30 return true; // dequeue
35 http://php.net/ returned 200