public function getApiClient()
    {
        $stack = HandlerStack::create();

        $middleware = new Oauth1([
            'consumer_key' => $this->configuration->getConsumerKey(),
            'consumer_secret' => $this->configuration->getConsumerSecret(),
            'token' => $this->configuration->getToken(),
            'token_secret' => $this->configuration->getTokenSecret()
        ]);
        $stack->push($middleware);

        $client = new Client([
            'base_uri' => $this->configuration->getBaseUri(),
            'handler' => $stack,
            'auth' => 'oauth',
            'headers' => [
                'Content-Type' => 'application/json',
            ],
            'http_errors' => $this->configuration->getHttpErrors(),
        ]);

        return $client;
    }
public function getApiClient()
    {
        $stack = HandlerStack::create();

        $middleware = new Oauth1([
            'consumer_key' => $this->configuration->getConsumerKey(),
            'consumer_secret' => $this->configuration->getConsumerSecret(),
            'token' => $this->configuration->getToken(),
            'token_secret' => $this->configuration->getTokenSecret()
        ]);
        $stack->push($middleware);

        $client = new Client([
            'base_uri' => $this->configuration->getBaseUri(),
            'handler' => $stack,
            'auth' => 'oauth',
            'headers' => [
                'Content-Type' => 'application/json',
            ],
            'http_errors' => $this->configuration->getHttpErrors(),
        ]);

        return $client;
    }
public function getApiClient ( ) { $ stack = HandlerStack :: create ( ) ; $ middleware = new Oauth1 ( [ 'consumer_key' => $ this -> configuration -> getConsumerKey ( ) , 'consumer_secret' => $ this -> configuration -> getConsumerSecret ( ) , 'token' => $ this -> configuration -> getToken ( ) , 'token_secret' => $ this -> configuration -> getTokenSecret ( ) ] ) ; $ stack -> push ( $ middleware ) ; $ client = new Client ( [ 'base_uri' => $ this -> configuration -> getBaseUri ( ) , 'handler' => $ stack , 'auth' => 'oauth' , 'headers' => [ 'Content-Type' => 'application/json' , ] , 'http_errors' => $ this -> configuration -> getHttpErrors ( ) , ] ) ; return $ client ; }
Get new api client.

@return Client
Get new api client .