public function getRongClound($url = "http://api-cn.ronghub.com", $data = "")
{
$app_key = '';
$secret = '`在这里插入代码片`';
$nonce = mt_rand();
$timeStamp = time();
$signature = sha1($secret . $nonce . $timeStamp);
$httpHeader = array(
'App-Key:' . $app_key,
'Nonce:' . $nonce,
'Timestamp:' . $timeStamp,
'Signature:' . $signature,
'Content-Type: application/x-www-form-urlencoded',
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_HTTPHEADER, $httpHeader);
curl_setopt($ch, CURLOPT_TIMEOUT, 30);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
$data = curl_exec($ch);
curl_close($ch);
return $data;
}
|