You are here

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

Same name in this branch
  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()
Same name and namespace in other branches
  1. 8.4 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::initializeHttpClient()
  2. 8.3 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::initializeHttpClient()

Parameters

string $serviceUrl:

bool $debug:

Return value

Client

File

api-sdk-php/src/BaseApiAbstract.php, line 218

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', [
        self::getCurrentClientId(),
        self::getCurrentClientVersion(),
        GuzzleHttp\default_user_agent(),
      ]),
    ],
  ]);
  return $client;
}