function requst($data,$url){
//云信验证参数
//$appKey = '1';
$appKey = '1';
//$appSecret = '1';
$appSecret = '1';
$nonce = '1';
$curTime = time();
$checkSum = sha1($appSecret . $nonce . $curTime);
$data = http_build_query($data);
$opts = array (
'http' => array(
'method' => 'POST',
'header' => array(
'Content-Type:application/x-www-form-urlencoded;charset=utf-8',
"AppKey:$appKey",
"Nonce:$nonce",
"CurTime:$curTime",
"CheckSum:$checkSum"
),
'content' => $data
),
);
$context = stream_context_create($opts);
$html = file_get_contents($url, false, $context);
echo $html;
}
$data = array('accid'=>'test','name'=>'test','token'=>123456);
requst($data,'https://api.netease.im/nimserver/user/create.action');
//云信验证参数
//$appKey = '1';
$appKey = '1';
//$appSecret = '1';
$appSecret = '1';
$nonce = '1';
$curTime = time();
$checkSum = sha1($appSecret . $nonce . $curTime);
$data = http_build_query($data);
$opts = array (
'http' => array(
'method' => 'POST',
'header' => array(
'Content-Type:application/x-www-form-urlencoded;charset=utf-8',
"AppKey:$appKey",
"Nonce:$nonce",
"CurTime:$curTime",
"CheckSum:$checkSum"
),
'content' => $data
),
);
$context = stream_context_create($opts);
$html = file_get_contents($url, false, $context);
echo $html;
}
$data = array('accid'=>'test','name'=>'test','token'=>123456);
requst($data,'https://api.netease.im/nimserver/user/create.action');