我正在使用Huawei E8372,用于在PHP中显示我的短信列表
我尝试了一个代码,但是没有用
显示错误125002
在我的代码下面
$MODEM_IP="192.168.8.1";
$ch = curl_init("http://$MODEM_IP/api/webserver/SesTokInfo");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$txResult = curl_exec($ch);
//echo $txResult;
$Token=substr($txResult,57,32);
$Session=substr($txResult,108,128);
//echo $Token;
//echo $Session;
$url = "http://192.168.8.1/api/sms/sms-list";
//echo $url;
//exit();
$data='<request><PageIndex>1</PageIndex><ReadCount>3</ReadCount><BoxType>1</BoxType><SortType>0</SortType><Ascending>0</Ascending><UnreadPreferred>1</UnreadPreferred></request>';
$ch = curl_init();
$params = array('Username' => "XXX",
'Password'=>"XXX",'data'=>$data);
curl_setopt($ch,CURLOPT_URL, $url);
curl_setopt($ch,CURLOPT_POST, count($params));
curl_setopt($ch,CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'__RequestVerificationToken'=> $Token, "Content-Type"=>'text/xml'
));
curl_setopt($ch, CURLOPT_COOKIE, 'Cookie='.$Session);
$result = curl_exec($ch);
echo "<Br>".$result."<BR>";