• Модуль: socialservices
  • Путь к файлу: ~/bitrix/modules/socialservices/classes/general/bitrix24net.php
  • Класс: CBitrix24NetTransport
  • Вызов: CBitrix24NetTransport::call
public function call($methodName, $additionalParams = null, $lang = null)
{
	if(!is_array($additionalParams))
	{
		$additionalParams = [];
	}

	$request = $this->prepareRequest($additionalParams, $lang);

	$http = new BitrixMainWebHttpClient([
		'socketTimeout' => $this->httpTimeout,
		'streamTimeout' => $this->httpTimeout,
	]);
	if ($lang)
	{
		$http->setCookies(['USER_LANG' => $lang]);
	}
	$result = $http->post(
		$this->networkNode . self::SERVICE_URL . $methodName,
		$request
	);

	try
	{
		$res = $this->prepareResponse($result);
	}
	catch(BitrixMainArgumentException $e)
	{
		$res = false;
	}

	if(!$res)
	{
		AddMessage2Log('Strange answer from Network! '.$http->getStatus().' '.$result);
	}

	return $res;
}