本文整理汇总了PHP中RequestUtil::httpPost方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestUtil::httpPost方法的具体用法?PHP RequestUtil::httpPost怎么用?PHP RequestUtil::httpPost使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestUtil
的用法示例。
在下文中一共展示了RequestUtil::httpPost方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
$url = wxCreateBottommenuUrl() . WxUtil::getWxTokenFromDB();
$menustr = '{
"button": [
{
"type": "view",
"name": "资讯",
"url": "http://bangmaisiw.w107.mc-test.com/wap/News.php"
},
{
"name": "互动",
"sub_button": [
{
"type": "view",
"name": "来稿说明",
"url": "http://bangmaisiw.w107.mc-test.com/wap/Engage.php"
},
{
"type": "click",
"name": "进入聊天室",
"key": "enterChatingroom"
},
{
"type": "click",
"name": "退出聊天室",
"key": "exitChatingroom"
}
]
},
{
"name": "服务",
"sub_button": [
{
"type": "view",
"name": "学习主题",
"url": "http://bangmaisiw.w107.mc-test.com/wap/Theme.php"
},
{
"type": "view",
"name": "公开研讨课",
"url": "http://bangmaisiw.w107.mc-test.com/wap/Course.php"
},
{
"type": "view",
"name": "定制服务",
"url": "http://bangmaisiw.w107.mc-test.com/wap/Ordering.php"
},
{
"type": "view",
"name": "网页聊天室",
"url": "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wx6f9dc2bfd436b651&redirect_uri=http%3A%2F%2Fbangmaisiw.w107.mc-test.com%2Fwap%2Fchatingroom%2Fwxoauth.php&response_type=code&scope=snsapi_base&state=callback#wechat_redirect"
}
]
}
]
}';
$respArr = RequestUtil::httpPost($url, $menustr, 'post');
if ($respArr["errcode"] == 0) {
return "菜单初始化成功,将在24小时内生效。";
}
return $respArr["errcode"] . ":" . $respArr["errmsg"];
}
示例2: init
function init()
{
$url = wxCreateBottommenuUrl() . WxUtil::getWxTokenFromDB();
$menustr = '{
"button": [
{
"type": "view",
"name": "资讯",
"url": "http://demo.alsovalue.com/BONZWISE/News-List.html"
},
{
"name": "互动",
"sub_button": [
{
"type": "click",
"name": "问答",
"key": "askAndAnwser"
},
{
"type": "view",
"name": "来稿说明",
"url": "demo.alsovalue.com/BONZWISE/Draft-Description.html"
}
{
"type": "click",
"name": "进入聊天室",
"key": "enterChatingroom"
},
{
"type": "click",
"name": "退出聊天室",
"key": "exitChatingroom"
}
]
},
{
"name": "服务",
"sub_button": [
{
"type": "view",
"name": "学习主题",
"url": "demo.alsovalue.com/BONZWISE/LearningTopics.html"
},
{
"type": "view",
"name": "公开研讨课",
"url": "demo.alsovalue.com/BONZWISE/PublicationSeminar.html"
},
{
"type": "view",
"name": "定制服务",
"url": "demo.alsovalue.com/BONZWISE/CustomizedService.html"
}
]
}
]
}';
$respArr = RequestUtil::httpPost($url, $menustr, 'post');
echo $respArr["errmsg"];
}
示例3: uploadmultipicmsg
/**
* 根据图片素材的id,拼装多图文素材
* $mediaid
* $title 图文消息的标题 不可空
$sourceurl 阅读原文的链接 可空
$content 图文 的 文, 不可空
$digest 图片消息的描述, 可空
$showcoverpic 是否显示封面,1为显示,0为不显示
*
*/
public static function uploadmultipicmsg($articles)
{
$url = wxUploadPicMsg() . WxUtil::getWxTokenFromDB();
//$articles[] = $article;
$dataarr = array("articles" => $articles);
$data = JsonUtil::getJsonStrFromArray($dataarr);
//echo $data;
$response = RequestUtil::httpPost($url, $data, 'post');
return $response;
}
示例4: batchSendPicMsgYulan
/**
* 图文消息推送预览接口
*/
public function batchSendPicMsgYulan($openidarr, $mediaid)
{
$yulanurl = "https://api.weixin.qq.com/cgi-bin/message/mass/preview?access_token=";
$data = array("touser" => $openidarr, "mpnews" => array("media_id" => $mediaid), "msgtype" => "mpnews");
$datastr = JsonUtil::getJsonStrFromArray($data);
//echo print_r($datastr);
$url = $yulanurl . WxUtil::getWxTokenFromDB();
$response = RequestUtil::httpPost($url, $datastr, 'post');
if ($response['errcode'] == 0) {
return "图文消息群发成功";
}
return $respArr["errcode"] . ":" . $respArr["errmsg"];
}