public function prepareRequest(RequestInterface $request, array $requestOptions = [])
{
if ($this->authStrategy === self::BASIC) {
$requestOptions = array_merge($requestOptions, ['auth' => [$this->authOptions['username'] . '/token', $this->authOptions['token'], 'basic']]);
} elseif ($this->authStrategy === self::OAUTH) {
$oAuthToken = $this->authOptions['token'];
$request = $request->withAddedHeader('Authorization', ' Bearer ' . $oAuthToken);
} else {
throw new AuthException('Please set authentication to send requests.');
}
return [$request, $requestOptions];
}