oauth2_client/client.py
def request(self, method, url, *args, **kwargs):  # pylint: disable=arguments-differ
        """
        Intercepts all requests, transforms relative URL to absolute and add the OAuth 2 token if present.
        Any communication issues are indicated by raising `CircuitBreakerError`. In this case communication
        can be reattempted in 10s, after the breaker resets.

        Arguments:
            method (str): HTTP method e.g. POST, GET.
            url (str): relative request URL.

        Returns:
            Response object.

        Raises:
            CircuitBreakerError:
                1) token expiry was detected and new token fetched, but we still get errors in
                    communication upon retrying request
                2) any unexpected error when handling the request
        """
        absolute_url = urljoin(self.service_host, url)
        try:
            return self.make_request(method, absolute_url, *args, **kwargs)
        except TokenExpiredError:
            log.debug("Attempting to fetch a new token for %s", self.app)
            new_token = fetch_and_store_token(self.app)
            self.token = new_token.to_client_dict()
            return self.make_request(method, absolute_url, *args, **kwargs)

        Intercepts all requests, transforms relative URL to absolute and add the OAuth 2 token if present.
        Any communication issues are indicated by raising `CircuitBreakerError`. In this case communication
        can be reattempted in 10s, after the breaker resets.

        Arguments:
            method (str): HTTP method e.g. POST, GET.
            url (str): relative request URL.

        Returns:
            Response object.

        Raises:
            CircuitBreakerError:
                1) token expiry was detected and new token fetched, but we still get errors in
                    communication upon retrying request
                2) any unexpected error when handling the request
        
Intercepts all requests, transforms relative URL to absolute and add the OAuth 2 token if present.
Any communication issues are indicated by raising `CircuitBreakerError`. In this case communication
can be reattempted in 10s, after the breaker resets.
Intercepts all requests transforms relative URL to absolute and add the OAuth 2 token if present . Any communication issues are indicated by raising ` CircuitBreakerError ` . In this case communication can be reattempted in 10s after the breaker resets .
def request(self, method, url, *args, **kwargs):  
        absolute_url = urljoin(self.service_host, url)
        try:
            return self.make_request(method, absolute_url, *args, **kwargs)
        except TokenExpiredError:
            log.debug("Attempting to fetch a new token for %s", self.app)
            new_token = fetch_and_store_token(self.app)
            self.token = new_token.to_client_dict()
            return self.make_request(method, absolute_url, *args, **kwargs)
def request ( self , method , url , * args , ** kwargs ) : absolute_url = urljoin ( self . service_host , url ) try : return self . make_request ( method , absolute_url , * args , ** kwargs ) except TokenExpiredError : log . debug ( "Attempting to fetch a new token for %s" , self . app ) new_token = fetch_and_store_token ( self . app ) self . token = new_token . to_client_dict ( ) return self . make_request ( method , absolute_url , * args , ** kwargs )
Intercepts all requests, transforms relative URL to absolute and add the OAuth 2 token if present.
Intercepts all requests transforms relative URL to absolute and add the OAuth 2 token if present .
# pylint: disable=arguments-differ """
        Intercepts all requests, transforms relative URL to absolute and add the OAuth 2 token if present.
        Any communication issues are indicated by raising `CircuitBreakerError`. In this case communication
        can be reattempted in 10s, after the breaker resets.

        Arguments:
            method (str): HTTP method e.g. POST, GET.
            url (str): relative request URL.

        Returns:
            Response object.

        Raises:
            CircuitBreakerError:
                1) token expiry was detected and new token fetched, but we still get errors in
                    communication upon retrying request
                2) any unexpected error when handling the request
        """
None
1) token expiry was detected and new token fetched, but we still get errors in
communication upon retrying request
2) any unexpected error when handling the request
1 ) token expiry was detected and new token fetched but we still get errors in communication upon retrying request 2 ) any unexpected error when handling the request
CircuitBreakerError
self
method
HTTP method e.g. POST, GET.
HTTP method e . g . POST GET .
url
relative request URL.
relative request URL .