protected function BaseApiAbstract::getDefaultRequestData in TMGMT Translator Smartling 8.2
Same name in this branch
- 8.2 api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
- 8.2 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
Same name and namespace in other branches
- 8.4 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
- 8.3 vendor/smartling/api-sdk-php/src/BaseApiAbstract.php \Smartling\BaseApiAbstract::getDefaultRequestData()
File
- vendor/
smartling/ api-sdk-php/ src/ BaseApiAbstract.php, line 261
Class
- BaseApiAbstract
- Class BaseApiAbstract
Namespace
SmartlingCode
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;
}