private function executeHttpRequest(RequestInterface $httpRequest)
    {
        // Authorization
        if ($this->authenticationMethod) {
            $this->authenticationMethod->authorizeRequest($this, $httpRequest);
        }

        // Execution
        $httpResponse = $this->client->send($httpRequest);

        // If Unauthorized, maybe the authorization just timed out.
        // Try it again to be sure.
        if ($httpResponse->getStatusCode() == 401 && $this->authenticationMethod != null) {
            // Authorize again
            $this->authenticationMethod->authorizeRequest($this, $httpRequest);

            // Execute again
            $httpResponse = $this->client->send($httpRequest);
        }

        return $httpResponse;
    }
private function executeHttpRequest(RequestInterface $httpRequest)
    {
        // Authorization
        if ($this->authenticationMethod) {
            $this->authenticationMethod->authorizeRequest($this, $httpRequest);
        }

        // Execution
        $httpResponse = $this->client->send($httpRequest);

        // If Unauthorized, maybe the authorization just timed out.
        // Try it again to be sure.
        if ($httpResponse->getStatusCode() == 401 && $this->authenticationMethod != null) {
            // Authorize again
            $this->authenticationMethod->authorizeRequest($this, $httpRequest);

            // Execute again
            $httpResponse = $this->client->send($httpRequest);
        }

        return $httpResponse;
    }
private function executeHttpRequest ( RequestInterface $ httpRequest ) { // Authorization if ( $ this -> authenticationMethod ) { $ this -> authenticationMethod -> authorizeRequest ( $ this , $ httpRequest ) ; } // Execution $ httpResponse = $ this -> client -> send ( $ httpRequest ) ; // If Unauthorized, maybe the authorization just timed out. // Try it again to be sure. if ( $ httpResponse -> getStatusCode ( ) == 401 && $ this -> authenticationMethod != null ) { // Authorize again $ this -> authenticationMethod -> authorizeRequest ( $ this , $ httpRequest ) ; // Execute again $ httpResponse = $ this -> client -> send ( $ httpRequest ) ; } return $ httpResponse ; }
Sends the HTTP request.
@param RequestInterface $httpRequest The HTTP request to send.
@return ResponseInterface HTTP response.
Sends the HTTP request .