curl
post请求
$ch = curl_init();
$header = array();
$header[] = 'Content-Type: application/json;charset:utf-8';
$header[] = 'Content-Length:' . strlen($data);
$header[] = "AppKey: ".C('netease_vcloud_appKey');
$header[] = "Nonce: ".C('netease_vcloud_nonce');
$header[] = "CurTime: ".$time;
$header[] = "CheckSum: ".sha1(C('netease_vcloud_appSecret').C('netease_vcloud_nonce').$time);
curl_setopt($ch, CURLOPT_URL, $api);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 120);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_POSTFIELDS , $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
return $output;
curl_close($ch);