public function __construct($baseUrl = '', $config = null, $tokens = null)
 {
     if ($tokens) {
         $this->setUserTokens($tokens);
     }
     parent::__construct($baseUrl, $config);
 }
Exemple #2
0
 public function __construct($emailAddress, $apiToken, $apiUrl)
 {
     $this->emailAddress = $emailAddress;
     $this->apiToken = $apiToken;
     $this->apiUrl = $apiUrl;
     parent::__construct($apiUrl, array('curl.options' => array('CURLOPT_FOLLOWLOCATION' => 1, 'CURLOPT_MAXREDIRS' => 10, 'CURLOPT_TIMEOUT' => 10, 'CURLOPT_USERPWD' => $emailAddress . '/token:' . $apiToken)));
     $this->setDefaultHeaders(array('Content-type' => 'application/json', 'User-Agent' => 'MozillaXYZ/1.0'));
 }
 public function __construct($api_key, $url = 'https://bigboard.us')
 {
     parent::__construct();
     $this->setBaseUrl($url);
     $this->setSslVerification(false, false, false);
     $this->setUserAgent("BigBoardSDK/0.1");
     $this->setDefaultOption('headers', array('X-BigBoard-Token' => $api_key, 'Content-Type' => "text/json"));
 }
Exemple #4
0
 public function __construct($baseUrl = '', $config = null)
 {
     // @codeCoverageIgnoreStart
     if (PHP_VERSION < self::MINIMUM_PHP_VERSION) {
         throw new UnsupportedVersionError(sprintf('You must have PHP version >= %s installed.', self::MINIMUM_PHP_VERSION));
     }
     // @codeCoverageIgnoreEnd
     parent::__construct($baseUrl, $config);
 }
 /**
  * Public constructor.
  *
  * Enables backoff support.
  *
  * @param string $baseUrl Base URL of the web service.
  * @param string $backoffRegex Optional error pattern to
  *                             search for in response bodies.
  */
 public function __construct($baseUrl = '', $backoffRegex = null)
 {
     if (is_string($backoffRegex)) {
         $backoffPlugin = new BackoffPlugin(new ResponseMatchesBackoffStrategy($backoffRegex));
     } else {
         $backoffPlugin = BackoffPlugin::getExponentialBackoff();
     }
     $config = array('request.options' => array('plugins' => array($backoffPlugin)));
     parent::__construct($baseUrl, $config);
 }
Exemple #6
0
 public function __construct($baseUrl = '', $config = null, ProviderInterface $provider = null, AccessToken $tokens = null)
 {
     if ($tokens) {
         $this->setUserTokens($tokens);
     }
     if ($provider) {
         $this->setProvider($provider);
     }
     parent::__construct($baseUrl, $config);
 }
 /**
  * Build a new Http request
  * @param array  $auth    [apikey, apisecret]
  * @param string $method  http method
  * @param string $url     call url
  * @param array  $filters Mailjet resource filters
  * @param array  $body    Mailjet resource body
  * @param string $type    Request Content-type
  */
 public function __construct($auth, $method, $url, $filters, $body, $type)
 {
     parent::__construct();
     $this->setUserAgent(Config::USER_AGENT . phpversion() . '/' . Client::WRAPPER_VERSION);
     $this->type = $type;
     $this->auth = $auth;
     $this->method = $method;
     $this->url = $url;
     $this->filters = $filters;
     $this->body = $body;
 }
Exemple #8
0
 /**
  * @param array       $config
  * @param string|null $proxy
  */
 public function __construct(array $config, $proxy = null)
 {
     $defaults = ['base_url' => 'https://btc-e.com/'];
     $required = ['base_url', 'api_key', 'api_secret'];
     if (null !== $proxy) {
         $defaults[self::REQUEST_OPTIONS] = ['proxy' => $proxy, 'verify' => false];
     }
     $config = Collection::fromConfig($config, $defaults, $required);
     $this->apiKey = $config->get('api_key');
     $this->apiSecret = $config->get('api_secret');
     $config->set('exceptions', false);
     parent::__construct($config->get('base_url'), $config);
 }
Exemple #9
0
 public function __construct($token)
 {
     $url = sprintf($token);
     parent::__construct($url);
     //$this->setDefaultOption('query', array('token' => $token));
 }
 public function __construct()
 {
     parent::__construct(Keyring::getAppUrlRegion());
 }
Exemple #11
0
 public function __construct($baseUrl)
 {
     parent::__construct($baseUrl);
 }
Exemple #12
0
 public function __construct($team, $token)
 {
     $url = sprintf("https://%s.slack.com", $team);
     parent::__construct($url);
     $this->setDefaultOption('query', array('token' => $token));
 }
 public function __construct(array $config = array())
 {
     parent::__construct('', $config);
     $this->config = array_merge($this->config, $config);
 }
Exemple #14
0
 public function __construct($baseUrl = '', $config = null)
 {
     parent::__construct($baseUrl, $config);
     $cookiePlugin = new CookiePlugin(new ArrayCookieJar());
     $this->addSubscriber($cookiePlugin);
 }
 public function __construct($baseUrl)
 {
     parent::__construct();
     $this->setUserAgent(self::USER_AGENT);
     $this->setBaseUrl($baseUrl);
 }