public function send(RequestInterface $request)
    {
        $deferred = new Deferred();
        try {
            $response = $this->call($request);
            $deferred->resolve($response);
        } catch (\Exception $caught) {
            $deferred->reject($caught);
        }

        return $deferred->promise();
    }
public function send(RequestInterface $request)
    {
        $deferred = new Deferred();
        try {
            $response = $this->call($request);
            $deferred->resolve($response);
        } catch (\Exception $caught) {
            $deferred->reject($caught);
        }

        return $deferred->promise();
    }
public function send ( RequestInterface $ request ) { $ deferred = new Deferred ( ) ; try { $ response = $ this -> call ( $ request ) ; $ deferred -> resolve ( $ response ) ; } catch ( \ Exception $ caught ) { $ deferred -> reject ( $ caught ) ; } return $ deferred -> promise ( ) ; }
Send out an HTTP requests returning a promise

@param RequestInterface $request

@return PromiseInterface
Send out an HTTP requests returning a promise