You are here

protected function BaseApiAbstract::getDefaultRequestData in TMGMT Translator Smartling 8.4

Same name and namespace in other branches
  1. 8.2 api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
  2. 8.2 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
  3. 8.3 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
44 calls to BaseApiAbstract::getDefaultRequestData()
AuditLogApi::createAccountLevelLogRecord in vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php
AuditLogApi::createProjectLevelLogRecord in vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php
AuditLogApi::searchAccountLevelLogRecord in vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php
AuditLogApi::searchProjectLevelLogRecord in vendor/smartling/api-sdk-php/src/AuditLog/AuditLogApi.php
AuthTokenProvider::authenticate in vendor/smartling/api-sdk-php/src/AuthApi/AuthTokenProvider.php
Sends /authenticate request

... See full list

1 method overrides BaseApiAbstract::getDefaultRequestData()
ContextApi::getDefaultRequestData in vendor/smartling/api-sdk-php/src/Context/ContextApi.php

File

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

Class

BaseApiAbstract
Class BaseApiAbstract

Namespace

Smartling

Code

protected function getDefaultRequestData($parametersType, $parameters, $auth = true, $httpErrors = false) {
  $options = [
    'headers' => [
      'Accept' => 'application/json',
    ],
    'exceptions' => $httpErrors,
  ];
  if ($auth) {
    $accessToken = $this
      ->getAuth()
      ->getAccessToken();
    $tokenType = $this
      ->getAuth()
      ->getTokenType();
    $options['headers']['Authorization'] = vsprintf('%s %s', [
      $tokenType,
      $accessToken,
    ]);
  }
  $options[$parametersType] = $parameters;
  return $options;
}