Commit 34ec72bf authored by Kulya's avatar Kulya 😊

Update Billz Curl check7

parent bb5f66d5
...@@ -187,21 +187,43 @@ require_once (__DIR__.'/keys.php'); ...@@ -187,21 +187,43 @@ require_once (__DIR__.'/keys.php');
try try
{ {
$obCurl = curl_init(); $obCurl = curl_init();
curl_setopt($obCurl, CURLOPT_URL, $url);
curl_setopt($obCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($obCurl, CURLOPT_POSTREDIR, 10);
curl_setopt($obCurl, CURLOPT_USERAGENT, 'Bitrix24' . static::VERSION);
curl_setopt($obCurl, CURLOPT_POST, true);
curl_setopt($obCurl, CURLOPT_POSTFIELDS, $sendData);
curl_setopt($obCurl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($obCurl, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($obCurl, CURLOPT_SSL_VERIFYHOST, false);
$headers = array(); curl_setopt_array($curl, array(
$headers[] = "Content-Type: application/json; charset=UTF-8"; CURLOPT_URL => $url,
$headers[] = "Authorization: Bearer ".$arSettings["token"]; CURLOPT_USERAGENT => "TugBitrix24",
$headers[] = "Cache-Control: no-cache"; CURLOPT_RETURNTRANSFER => true,
curl_setopt($obCurl, CURLOPT_HTTPHEADER, $headers); CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_POSTFIELDS =>$sendData,
CURLOPT_SSL_VERIFYPEER =>false,
CURLOPT_SSL_VERIFYHOST =>false,
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer '.$arSettings["token"],
'Content-Type: application/json'
),
));
// curl_setopt($obCurl, CURLOPT_URL, $url);
// curl_setopt($obCurl, CURLOPT_RETURNTRANSFER, true);
// curl_setopt($obCurl, CURLOPT_POSTREDIR, 10);
// curl_setopt($obCurl, CURLOPT_USERAGENT, 'Bitrix24' . static::VERSION);
// curl_setopt($obCurl, CURLOPT_POST, true);
// curl_setopt($obCurl, CURLOPT_POSTFIELDS, $sendData);
// curl_setopt($obCurl, CURLOPT_FOLLOWLOCATION, 1);
// curl_setopt($obCurl, CURLOPT_SSL_VERIFYPEER, false);
// curl_setopt($obCurl, CURLOPT_SSL_VERIFYHOST, false);
// $headers = array();
// $headers[] = "Content-Type: application/json; charset=UTF-8";
// $headers[] = "Authorization: Bearer ".$arSettings["token"];
// $headers[] = "Cache-Control: no-cache";
// curl_setopt($obCurl, CURLOPT_HTTPHEADER, $headers);
$out = curl_exec($obCurl); $out = curl_exec($obCurl);
$info = curl_getinfo($obCurl); $info = curl_getinfo($obCurl);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment