'http://httpbin.org/']); Lib\printf('promise'); $promise = $client->getAsync('/get'); Lib\printf('then'); $promise->then( function (ResponseInterface $res) { echo $res->getStatusCode() . "\n"; }, function (RequestException $e) { echo $e->getMessage() . "\n"; echo $e->getRequest()->getMethod(); } ); Lib\printf('wait'); $promise->wait(); Lib\printf('end');