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_array($curl, array(
curl_setopt($obCurl, CURLOPT_POSTREDIR, 10); CURLOPT_URL => $url,
curl_setopt($obCurl, CURLOPT_USERAGENT, 'Bitrix24' . static::VERSION); CURLOPT_USERAGENT => "TugBitrix24",
curl_setopt($obCurl, CURLOPT_POST, true); CURLOPT_RETURNTRANSFER => true,
curl_setopt($obCurl, CURLOPT_POSTFIELDS, $sendData); CURLOPT_ENCODING => '',
curl_setopt($obCurl, CURLOPT_FOLLOWLOCATION, 1); CURLOPT_MAXREDIRS => 10,
curl_setopt($obCurl, CURLOPT_SSL_VERIFYPEER, false); CURLOPT_TIMEOUT => 0,
curl_setopt($obCurl, CURLOPT_SSL_VERIFYHOST, false); CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
$headers = array(); CURLOPT_CUSTOMREQUEST => 'GET',
$headers[] = "Content-Type: application/json; charset=UTF-8"; CURLOPT_POSTFIELDS =>$sendData,
$headers[] = "Authorization: Bearer ".$arSettings["token"]; CURLOPT_SSL_VERIFYPEER =>false,
$headers[] = "Cache-Control: no-cache"; CURLOPT_SSL_VERIFYHOST =>false,
curl_setopt($obCurl, CURLOPT_HTTPHEADER, $headers); 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