public function sendRequest(RequestInterface $request, array $options = []): ResponseInterface
    {
        $chain = $this->createMiddlewareChain($this->middleware, function (RequestInterface $request, callable $responseChain) use ($options) {
            $response = $this->client->sendRequest($request, $options);
            $responseChain($request, $response);
        }, function (RequestInterface $request, ResponseInterface $response) {
            $this->lastRequest = $request;
            $this->lastResponse = $response;
        });

        // Call the chain
        $chain($request);

        return $this->lastResponse;
    }
public function sendRequest(RequestInterface $request, array $options = []): ResponseInterface
    {
        $chain = $this->createMiddlewareChain($this->middleware, function (RequestInterface $request, callable $responseChain) use ($options) {
            $response = $this->client->sendRequest($request, $options);
            $responseChain($request, $response);
        }, function (RequestInterface $request, ResponseInterface $response) {
            $this->lastRequest = $request;
            $this->lastResponse = $response;
        });

        // Call the chain
        $chain($request);

        return $this->lastResponse;
    }
public function sendRequest ( RequestInterface $ request , array $ options = [ ] ) : ResponseInterface { $ chain = $ this -> createMiddlewareChain ( $ this -> middleware , function ( RequestInterface $ request , callable $ responseChain ) use ( $ options ) { $ response = $ this -> client -> sendRequest ( $ request , $ options ) ; $ responseChain ( $ request , $ response ) ; } , function ( RequestInterface $ request , ResponseInterface $ response ) { $ this -> lastRequest = $ request ; $ this -> lastResponse = $ response ; } ) ; // Call the chain $ chain ( $ request ) ; return $ this -> lastResponse ; }
Send a PSR7 request.

@throws ClientException
@throws LogicException
@throws InvalidArgumentException
Send a PSR7 request .