• Модуль: seo
  • Путь к файлу: ~/bitrix/modules/seo/lib/engine/yandex.php
  • Класс: BitrixSeoEngineYandex
  • Вызов: Yandex::queryOld
protected function queryOld($scope, $method = "GET", $data = NULL, $skipRefreshAuth = false)
{
	if ($this->engineSettings['AUTH'])
	{
		$http = new CHTTP();
		$http->setAdditionalHeaders(
			array(
				'Authorization' => 'OAuth ' . $this->engineSettings['AUTH']['access_token'],
			)
		);
		$http->setFollowRedirect(false);
		
		switch ($method)
		{
			case 'GET':
				$result = $http->get($scope);
				break;
			case 'POST':
				$result = $http->post($scope, $data);
				break;
			case 'PUT':
				$result = $http->httpQuery($method, $scope, $http->prepareData($data));
				break;
			case 'DELETE':
				
				break;
		}
		
		if ($http->status == 401 && !$skipRefreshAuth)
		{
			if ($this->checkAuthExpired())
			{
				$this->queryOld($scope, $method, $data, true);
			}
		}
		
		$http->result = TextEncoding::convertEncoding($http->result, 'utf-8', LANG_CHARSET);
		
		return $http;
	}
}