You are here

protected static function BaseApiAbstract::initializeHttpClient in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.2 api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::initializeHttpClient()
  2. 8.2 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::initializeHttpClient()
  3. 8.3 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::initializeHttpClient()

Parameters

string $serviceUrl:

bool $debug:

Return value

Client

10 calls to BaseApiAbstract::initializeHttpClient()
AuditLogApi::create in vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php
AuthTokenProvider::create in vendor/smartling/api-sdk-php/src/AuthApi/AuthTokenProvider.php
Creates and returns instance of AuthTokenProvider
BatchApi::create in vendor/smartling/api-sdk-php/src/Batch/BatchApi.php
Instantiates Jobs Facade API object.
ContextApi::create in vendor/smartling/api-sdk-php/src/Context/ContextApi.php
Instantiates Context API object.
FileApi::create in vendor/smartling/api-sdk-php/src/File/FileApi.php

... See full list

File

vendor/smartling/api-sdk-php/src/BaseApiAbstract.php, line 238

Class

BaseApiAbstract
Class BaseApiAbstract

Namespace

Smartling

Code

protected static function initializeHttpClient($serviceUrl, $debug = false) {
  $client = new Client([
    'base_uri' => $serviceUrl,
    'debug' => $debug,
    'headers' => [
      'User-Agent' => vsprintf('%s/%s %s %s', [
        self::getCurrentClientId(),
        self::getCurrentClientVersion(),
        self::getCurrentClientUserAgentExtension(),
        GuzzleHttp\default_user_agent(),
      ]),
    ],
  ]);
  return $client;
}