本文整理汇总了PHP中RequestUtil::httpGet方法的典型用法代码示例。如果您正苦于以下问题:PHP RequestUtil::httpGet方法的具体用法?PHP RequestUtil::httpGet怎么用?PHP RequestUtil::httpGet使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RequestUtil
的用法示例。
在下文中一共展示了RequestUtil::httpGet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: initTicket
public static function initTicket($newToken)
{
$type = typeForTicket();
$ticketUrl = wxTicketUrl() . "?access_token=" . $newToken . "&type=" . $type;
//LogUtil::logs("wxindex.php initTicket url======>".$ticketUrl, getLogFile('/business.log'));
$returnArr = RequestUtil::httpGet($ticketUrl);
//LogUtil::logs("wxindex.php initTicket returnJsonStr======>".$returnArr, getLogFile('/business.log'));
if (0 == $returnArr["errcode"]) {
return $returnArr["ticket"];
}
return null;
}
示例2: getUserInfoFromWx
public function getUserInfoFromWx($openId)
{
// $batchUrl = "https://api.weixin.qq.com/cgi-bin/user/info/batchget?access_token=".WxUtil::getWxTokenFromDB();
// $pdata = '{
// "user_list": [
// {
// "openid": "'.$openId.'",
// "lang": "zh-CN"
// }
// ]
// }';
// RequestUtil::httpPost($batchUrl, $pdata, 'post');
$userInfoUrl = wxGetUserBaseinfo() . WxUtil::getWxTokenFromDB() . "&openid=" . $openId;
//LogUtil::logs("wxindex.php getUserInfoFromWx userInfoUrl====> ".$userInfoUrl, getLogFile("/business.log"));
$userInfo = RequestUtil::httpGet($userInfoUrl);
return $userInfo;
}
示例3: secret
<?php
require_once '../../weixin/RequestUtil.php';
require_once '../../weixin/DateUtil.php';
require_once '../../weixin/globleconfig.php';
require_once '../../weixin/LogUtil.php';
require_once '../configs/smarty.inc.php';
// http://www.jb51.net/article/48019.htm
if (isset($_GET["code"])) {
$code = $_GET["code"];
$secret = secret();
$appid = appid();
$oauthurl = wxOauth();
$url = $oauthurl . "?appid=" . $appid . "&secret=" . $secret . "&code=" . $code . "&grant_type=authorization_code";
//LogUtil::logs($url, getLogFile("/business.log"));
$returnJson = RequestUtil::httpGet($url);
// {"access_token":"OezXcEiiBSKSxW0eoylIeG_LpV4TpnX-BxNbAVVAasaRyPm55zyI9CKaVNciQOEw8iu_pEDXCiBKbbSJbzzqarhyfecqXoplnmCl7HsBiWFARy1Ob3MealEkubEDs8KHeRbAr5Awrvr7RR3i5t24GA","expires_in":7200,"refresh_token":"OezXcEiiBSKSxW0eoylIeG_LpV4TpnX-BxNbAVVAasaRyPm55zyI9CKaVNciQOEwUHOmtG9PkoiFUefqTDaX00sVqxhfoyE-jbYDCIjldLBnZvj1QP0gGev-Tw2BWQWTdIOnZ9EQDB0Oi0w2ZlT0lA","openid":"osp6swrNZiWtEuTy-Gj1cBVA1l38","scope":"snsapi_base"}
$openid = $returnJson["openid"];
if (!empty($returnJson["openid"])) {
$smarty->assign('openid', $openid);
$smarty->display('chatingroom/chating.html');
}
}