微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

在php中发布curl时“登录详细信息不能为空”

如何解决在php中发布curl时“登录详细信息不能为空”

这是我的代码

$senderid = $_POST['senderid'];
$tomsg =  $_POST['mobilenumber'];
$textmsg = $data;


 $url = 'http://global.smsindiahub.in/api/mt/SendSMS?';
$data = [
   'user' => "username",'password' => "password",'senderid' =>  $senderid,'channel' =>  'normal','DCS' =>  '0','flashsms' =>  '0','number' => $tomsg,'text' => $textmsg,];

$curl = curl_init($url . '?' . http_build_query($data));
curl_setopt($curl,CURLOPT_RETURNTRANSFER,true);
curl_setopt($curl,CURLOPT_POST,CURLOPT_HTTPHEADER,[

  'Content-Type: application/problem+json'
]);
$response = curl_exec($curl);
curl_close($curl);

这是输出

  Response: {"ErrorCode":"1","ErrorMessage":"login details cannot be blank",

我做错了什么?我已经尝试了一切,但每次都返回相同的错误

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。