Created
December 14, 2018 10:18
-
-
Save VSeryoga/1525ebcee34f43b19681963c75dd9e9a to your computer and use it in GitHub Desktop.
Batch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
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