首页 > 微信 > 详细

微信小程序内容安全检测curl

时间:2021-06-10 12:10:04      阅读:16      评论:0      收藏:0      [点我收藏+]
function curl_post_weixin($url,$content){
$curl = curl_init();
$headerArray =array("Content-type:application/json;charset=‘utf-8‘","Accept:application/json");
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST,FALSE);
curl_setopt($curl, CURLOPT_POST, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, 1);
curl_setopt($curl,CURLOPT_HTTPHEADER,$headerArray);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode($content,JSON_UNESCAPED_UNICODE)); //json格式不被转义加上JSON_UNESCAPED_UNICODE
$response = curl_exec($curl);
curl_close($curl);
$response=json_decode($response);
return $response;
}
检测图片
curl_setopt($curl, CURLOPT_POSTFIELDS, [‘media‘=>new CURLFILE($content)]); //实例化CURLFILE

微信小程序内容安全检测curl

原文:https://www.cnblogs.com/jiangjie050/p/14870080.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!