We have one small function with a lousy API that can do basic requests, but that's it. If we want to be serious about web services we need strong bidirectional HTTP support. - boombatower https://drupal.org/node/1447736 “
$url = 'http://httpbin.org'; $request = $client->createRequest('GET', $url); $emitter = $request->getEmitter(); • Clients and requests have them • Listeners and subscribers added to a client are added to every request
! $mockAdapter = new MockAdapter( function (TransactionInterface $trans) { // You have access to the request $request = $trans->getRequest(); // Return a response return new Response(200); } ); ! $client = new Client(['adapter' => $mockAdapter]);