当前位置:   article > 正文

php调http接口,2步教你解决http协议php接口调用

php接口转接http接口

http协议php短信接口调用代码示例:

1.提交方式与编码

http请求都应以POST形式提交,编码为UTF-8

2.部分核心代码示例如下final public static function sendSms($user,$password,$content,$mobiles){

$client = new HttpClient(self::HOST);

$client->setDebug(true);

if(! $client->post('/sdk/send' , array(

'accName' => $user,

'accPwd' => strtoupper(md5($password)),

'content' => mb_convert+encoding($content,'UTF-8',UTF-8),

'aimcodes' => $mobiles,

'dataType' =>"xml"

))){

return '-10000';

}else{

return self::_replyResult($client->getContent);

}

}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/270207
推荐阅读
相关标签
  

闽ICP备14008679号