Skip to content

Instantly share code, notes, and snippets.

@VSeryoga
Created December 14, 2018 10:18
Show Gist options
  • Save VSeryoga/1525ebcee34f43b19681963c75dd9e9a to your computer and use it in GitHub Desktop.
Save VSeryoga/1525ebcee34f43b19681963c75dd9e9a to your computer and use it in GitHub Desktop.
Batch
<?
function query($param)
{
// /* AUTH */
$domain = '';
$auth = '';
$user = '';
$appParams = array(
'halt' => 0,
'cmd' => $param
);
$appRequestUrl = 'https://'.$domain.'/rest/'.$user.'/'.$auth.'/batch?'.http_build_query($appParams);
$curl = curl_init();
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_URL,$appRequestUrl);
curl_setopt($curl,CURLOPT_POST,true);
curl_setopt($curl,CURLOPT_HEADER,false);
curl_setopt($curl,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($curl,CURLOPT_SSL_VERIFYHOST,0);
$out=curl_exec($curl);
curl_close($curl);
$result = json_decode($out, 1);
echo '<pre>';
print_r($result);
// writeToLog2($appParams);
return $result;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment