src/Bridge.php
public function request($method = 'GET', $uri = '', $options = [])
    {
        try {
            // Make the request.
            return $this->getClient()->request($method, $uri, $this->getRequestOptions($options));
        } catch (ClientException $e) {
            // We are using token auth and probably token expired.
            if ($this->authMethod == 'token' && $e->getCode() == 401 && ! $this->isThrottledReached()) {
                // Try refresh token.
                $this->fetchToken(true);

                // Try requesting again.
                return $this->request($method, $uri, $options);
            }
            // Clear throttle for this request.
            $this->clearThrottle();
            // Call Failed Request.
            $this->failedRequest($e->getResponse());
        }
    }
public function request($method = 'GET', $uri = '', $options = [])
    {
        try {
            // Make the request.
            return $this->getClient()->request($method, $uri, $this->getRequestOptions($options));
        } catch (ClientException $e) {
            // We are using token auth and probably token expired.
            if ($this->authMethod == 'token' && $e->getCode() == 401 && ! $this->isThrottledReached()) {
                // Try refresh token.
                $this->fetchToken(true);

                // Try requesting again.
                return $this->request($method, $uri, $options);
            }
            // Clear throttle for this request.
            $this->clearThrottle();
            // Call Failed Request.
            $this->failedRequest($e->getResponse());
        }
    }
public function request ( $ method = 'GET' , $ uri = '' , $ options = [ ] ) { try { // Make the request. return $ this -> getClient ( ) -> request ( $ method , $ uri , $ this -> getRequestOptions ( $ options ) ) ; } catch ( ClientException $ e ) { // We are using token auth and probably token expired. if ( $ this -> authMethod == 'token' && $ e -> getCode ( ) == 401 && ! $ this -> isThrottledReached ( ) ) { // Try refresh token. $ this -> fetchToken ( true ) ; // Try requesting again. return $ this -> request ( $ method , $ uri , $ options ) ; } // Clear throttle for this request. $ this -> clearThrottle ( ) ; // Call Failed Request. $ this -> failedRequest ( $ e -> getResponse ( ) ) ; } }
Make a Request to Watson with credentials Auth.

@param string $method
@param string $uri
@param array  $options

@return \GuzzleHttp\Psr7\Response
Make a Request to Watson with credentials Auth .