119 $httpClient->setHeader(
"User-Agent",
"Bitrix Integration B24");
120 $httpClient->setCharset(
"UTF-8");
125 $params = Encoding::convertEncoding($params, SITE_CHARSET,
"UTF-8");
128 $this->
log(
"\\----------\n");
129 $this->
log([
'endpoint'=>
$endPoint.$method,
'params'=>$params]);
130 $this->
log([
$endPoint.$method.
'?'.http_build_query($params)]);
132 $success = $httpClient->post(
$endPoint.$method, $params);
138 $result = $httpClient->getResult();
140 $this->
log([
'result'=>$result]);
141 $this->
log(
"\n ----------//\n");
145 $response = Json::decode($result);
150 "Wrong Rest Response. ".
$endPoint.$method.
"\n\n".mb_substr($result, 0, 1024)