我正尝试从安装了xamp的本地主机发送短信。 请求的页面位于https和.aspx页面上。 我收到错误:“HTTP错误400.请求形成严重。”或仅在某些情况下为空白页面。 Detaisl如下:如何使用xamp从本地主机的php脚本调用.aspx https?
$url = 'https://www.ismartsms.net/iBulkSMS/HttpWS/SMSDynamicAPI.aspx';
$postArgs = 'UserId='.$username.
'&Password='.$password.
'&MobileNo='.$destination.
'&Message='.$text.
'&PushDateTime='.$PushDateTime.
'&Lang='.$Lang;
function getSslPage($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
$result = curl_exec($ch);
curl_close($ch);
return $result;
}
$response = getSslPage($all);
echo "<pre>";
print_r($response); exit;
我想互联网上找到每一个可能的解决方案/组合,但未能解决这个问题。 API开发人员没有用于php脚本的示例。 我试过httpful php库和file_get_contents函数,但得到空白页面。还尝试了每个与curl_setup的组合。
我需要调用这个URL没有任何后期数据,并看到它的响应。 取而代之的是一个空白页面。
请注意,当我在浏览器中执行具有所有细节的url时,它工作正常。
任何人都可以在这方面帮助我。
谢谢 乌斯曼
$ all = $ url。“?”。$ postArgs; $ response = getSslPage($ all); –