當前位置: 首頁>>代碼示例>>PHP>>正文


PHP HttpClient::quickPost方法代碼示例

本文整理匯總了PHP中HttpClient::quickPost方法的典型用法代碼示例。如果您正苦於以下問題:PHP HttpClient::quickPost方法的具體用法?PHP HttpClient::quickPost怎麽用?PHP HttpClient::quickPost使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在HttpClient的用法示例。


在下文中一共展示了HttpClient::quickPost方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: http_post

 function http_post($opt, $data)
 {
     $url = $this->base . '&opt=' . $opt;
     if ($this->client_type == 'curl') {
         return $this->http->post($url, $data);
     } else {
         return HttpClient::quickPost($url, $data);
     }
 }
開發者ID:jinguanio,項目名稱:swoole_websocket,代碼行數:9,代碼來源:HttpSqs.php

示例2: papaki_DeleteNameserver

function papaki_DeleteNameserver($params)
{
    $username = '';
    $password = '';
    $apikey = encodetolatin($params["APIkey"]);
    $posturl = encodetolatin($params["PostUrl"]);
    $testmode = encodetolatin($params["TestMode"]);
    $tld = encodetolatin($params["tld"]);
    $sld = encodetolatin($params["sld"]);
    $nameserver = encodetolatin($params["nameserver"]);
    # Put your code to delete the nameserver here
    ########################
    $json = new Services_JSON();
    $jsonarray = array("request" => array("do" => 'deletens', "username" => $username, "password" => $password, "apiKey" => $apikey, "domainname" => $sld . "." . $tld, "registration_type" => '2', "test" => 'False', "ns" => $nameserver));
    $Xpost = $json->encode($jsonarray);
    $Xpost = latintogreek($Xpost);
    $headers = array('Content-type: application/x-www-form-urlencoded');
    $pageContents = HttpClient::quickPost($params["PostUrl"], array('message' => $Xpost));
    $responsearray = $json->decode($pageContents);
    $codeNode = $responsearray->response->code;
    $message = $responsearray->response->message;
    // if ($codeNode!="1000" ){
    // $values["error"]='Error: ' .  $codeNode . ' - ' .  $message;
    //}
    $values["error"] = 'Error: Not Supported';
    #####################################
    # If error, return the error message in the value below
    //  $values["error"] = $error;
    return $values;
}
開發者ID:voulaTroulaki,項目名稱:SimpleResellers_WordPressPlugin,代碼行數:30,代碼來源:papaki.php

示例3: eposSale

function eposSale(array $bizArray, $actionURL, $merchantKey, $logName)
{
    // 調用簽名函數生成簽名串
    $ReqHmacString = getReqHmacString($bizArray, $logName, $merchantKey);
    // 組成請求串
    $actionHttpString = HttpClient::buildQueryString($bizArray) . "&pr_NeedResponse=1" . "&hmac=" . $ReqHmacString;
    // echo $actionURL."?".$actionHttpString;exit;
    // 記錄發起支付請求的參數
    logurl("發起請求", $actionURL . "?" . $actionHttpString, $logName);
    // 發起支付請求
    $pageContents = HttpClient::quickPost($actionURL, $actionHttpString);
    if ($GLOBALS['uid'] == '20310462') {
        echo $pageContents . "<br>";
    }
    // 記錄收到的提交結果
    logurl("請求回寫", $pageContents, $logName);
    $result = explode("\n", $pageContents);
    for ($index = 0; $index < count($result); $index++) {
        $result[$index] = trim($result[$index]);
        if (strlen($result[$index]) == 0) {
            continue;
        }
        $aryReturn = explode("=", $result[$index]);
        $sKey = $aryReturn[0];
        $sValue = $aryReturn[1];
        if ($sKey == "r0_Cmd") {
            $r0_Cmd = $sValue;
        } elseif ($sKey == "r1_Code") {
            $r1_Code = $sValue;
        } elseif ($sKey == "r2_TrxId") {
            $r2_TrxId = $sValue;
        } elseif ($sKey == "r6_Order") {
            $r6_Order = $sValue;
        } elseif ($sKey == "errorMsg") {
            $errorMsg = $sValue;
        } elseif ($sKey == "hmac") {
            $hmac = $sValue;
        }
        /* else{
        		   return $result[$index];
        		}   */
    }
    $hmac = iconv("UTF-8", "GB2312", $hmac);
    // 進行校驗碼檢查 取得加密前的字符串
    $sbOld = "";
    // 加入業務類型
    $sbOld = $sbOld . $r0_Cmd;
    // 加入支付結果
    $sbOld = $sbOld . $r1_Code;
    // 加入易寶支付交易流水號
    $sbOld = $sbOld . $r2_TrxId;
    // 加入商戶訂單號
    $sbOld = $sbOld . $r6_Order;
    $sNewString = HmacMd5($sbOld, $merchantKey, $logName);
    logurl("訂單號:" . $r6_Order, "本地生成HMAC:" . $sNewString . "返回HMAC:" . $hmac, $logName);
    $uid = substruid($r6_Order, 14);
    $money = $bizArray['p3_Amt'];
    global $_MooClass, $dbTablePre;
    $sql_getpayid = "SELECT max(id) id FROM {$dbTablePre}payment_new WHERE order_id='{$r6_Order}'";
    $getpayid = $_MooClass['MooMySQL']->getOne($sql_getpayid, true);
    $id = $getpayid['id'];
    $sql_p = "SELECT pay_service FROM {$dbTablePre}payment_new WHERE id='{$id}'";
    $payservice = $_MooClass['MooMySQL']->getOne($sql_p, true);
    //	if($money=='1899'){
    //		$attach='0';
    //	}elseif($money=='1399'){
    //		$attach='1';
    //	}elseif($money=='1399.00'){
    //		$attach='2';
    //	}else{
    //		$attach='1';
    //	}
    //
    if ($payservice['pay_service'] == '0') {
        $attach = '0';
    } elseif ($payservice['pay_service'] == '1' || $payservice['pay_service'] == '3') {
        $attach = '1';
    } elseif ($payservice['pay_service'] == '2') {
        $attach = '2';
    } else {
        $attach = '1';
    }
    if ($GLOBALS['uid'] == '20310462') {
        echo $sNewString;
        exit;
    }
    // 校驗碼正確
    if ($sNewString == $hmac) {
        if ($r1_Code == "1") {
            logurl("請求成功", "本地生成HMAC:" . $sNewString . "返回HMAC:" . $hmac, $logName);
            //返回信息 數組表示
            $paytime = date("Y.m.d H:i:s");
            $payurl = array('pay' => '1', 'out_trade_no' => $r6_Order, 'paytime' => $paytime, 'bank_type' => '易寶支付', 'trade_state' => '0', 'get_img' => '05.gif', 'img' => $attach, 'total_fee' => $bizArray['p3_Amt'], 'uid' => $uid);
            //會員ID
            $payurl = implode(',', $payurl);
            $payurl = $payurl . ',yeepay';
            header("Location:./../../index.php?n=payment&h=payreturnurl&payurl=" . $payurl);
            return;
        } elseif ($r1_Code == "66") {
            $errorinfo = iconv("GB2312", "UTF-8", "訂單金額過小!");
//.........這裏部分代碼省略.........
開發者ID:noikiy,項目名稱:zays,代碼行數:101,代碼來源:yeepayeposcommon.php

示例4: getcode

 public function getcode()
 {
     $code = $this->rand_number(100000, 999999);
     //普通提交方式
     include_once 'HttpClient.class.php';
     //目標主機的地址,我這裏填上測試的地址
     $Client = new HttpClient("mssms.cn:8000");
     $url = "http://222.185.228.25:8000/msm/sdk/http/sendsmsutf8.jsp";
     //請求的頁麵地址
     //POST的參數
     $mobile = $this->_post('mobile');
     $params = array('username' => "JSMB260705", 'scode' => "095169", 'mobile' => $mobile, 'content' => "@1@={$code}", 'tempid' => "MB-2013102300");
     $pageContents = HttpClient::quickPost($url, $params);
     echo "提交返回=" . $pageContents;
     exit;
     $token = '540e6acfz71';
     $wecha_id = $this->_get('wecha_id');
     $tel = '15678456321';
     $cardnum = 'LZ948820080012';
     $where = array('token' => $token, 'tel' => $tel, 'cardnum' => $cardnum);
     //根據電話號碼驗證會員是否被導入
     $userinfo = M("physical_member")->where($where)->find();
     if (!$userinfo) {
         echo '{"success":0,"msg":"沒有找到您的會員卡信息,請聯係商家導入。"}';
         exit;
     } elseif ($userinfo['binded']) {
         echo '{"success":0,"msg":"此手機號已被綁定."}';
         exit;
     } elseif ($userinfo['cardnum'] != $cardnum) {
         echo '{"success":0,"msg":"您輸入的手機號與卡號不匹配,請重新輸入。"}';
         exit;
     }
     $Cache = Cache::getInstance('File', array('expire' => '310'));
     $scode = $Cache->get($token . $tel);
     if (!empty($scode)) {
         // 避免多次發送
         echo '{"success":0,"msg":"驗證碼已發送,請稍侯。"}';
         exit;
     }
     $code = $this->rand_number(100000, 999999);
     $Cache->set($token . $tel, $code);
     Log::record("Send code : " . $code . " at " . date("Y-m-d H:i:s") . "\r\n", Log::DEBUG);
     include LIB_PATH . 'Action/SmsSender.class.php';
     $smsSender = new SmsSender();
     $binding_tmpl = C('card_binding');
     $smsContent = '';
     if (isset($binding_tmpl)) {
         $smsContent = str_replace("#merchant#", '領眾科技', $binding_tmpl);
         $smsContent = str_replace("#code#", $code, $smsContent);
     }
     if ($smsContent != '') {
         $re = $smsSender->notify($this->_get('token'), "huiyuan", $smsContent, $tel);
         if ($re == 0) {
             $Cache->set($token . $tel, $code);
             echo '{"success":1,"msg":"驗證碼已發送,請輸入收到的短信驗證碼!"}';
         } else {
             echo '{"success":0,"msg":"驗證碼發送失敗,請稍侯再試。"}';
         }
     } else {
         echo '{"success":0,"msg":"驗證碼發送失敗,請稍侯再試。"}';
     }
 }
開發者ID:zhaoshengloveqingqing,項目名稱:Wechat,代碼行數:62,代碼來源:AppAction.class.php

示例5: exec_request_for

 function exec_request_for($type = _TYPE_DS, $use_get_extenssions_func = true)
 {
     $this->type = $type;
     //$exts=array('.'.$this->tld);
     $json = new Services_JSON();
     $jsonarray = array("request" => array("type" => $type, "apiKey" => encodetolatin($this->apikey), "username" => '', "password" => '', "domain" => encodetolatin($this->domainName), "lang" => 'el', "test" => 'False', "extensions" => array("ext" => array('.' . $this->tld))));
     if ($this->type == _TYPE_WHOIS) {
         $jsonarray = array("request" => array("type" => $type, "apiKey" => encodetolatin($this->apikey), "username" => '', "password" => '', "domain" => encodetolatin($this->domainName), "lang" => 'el', "test" => 'False'));
     }
     //print_r($jsonarray);
     $Xpost = $json->encode($jsonarray);
     $Xpost = latintogreek($Xpost);
     $headers = array('Content-type: application/x-www-form-urlencoded');
     //print '<pre>'.$Xpost.'<br /><br />'.'</pre>';
     $pageContents = HttpClient::quickPost($this->requestURL, array('message' => $Xpost));
     //print '<pre>'.$pageContents.'<br /><br />'.'</pre>';
     $this->responsearray = $json->decode($pageContents);
     //print_r($this->responsearray );
     $this->parseResponse();
     $this->domainName = $this->IDN->decode($this->domainName);
 }
開發者ID:voulaTroulaki,項目名稱:SimpleResellers_WordPressPlugin,代碼行數:21,代碼來源:usablewebLib.php

示例6: getOrderInfo

 public function getOrderInfo($trans_no, $type = 'normal')
 {
     require_once 'HttpClient.class.php';
     //業務類型
     $post_data['p0_Cmd'] = 'QueryOrdDetail';
     //商戶編號
     $post_data['p1_MerId'] = $this->MemberID;
     //商戶訂單號
     $post_data['p2_Order'] = $trans_no;
     //獲取簽名
     $post_data['hmac'] = $this->getHmacString($post_data, $this->merchantKey);
     $pageContents = HttpClient::quickPost($this->reqURL_Info, $post_data);
     $result = explode("\n", $pageContents);
     $result_arr = array();
     foreach ($result as $key => $value) {
         if ($value != '') {
             $tmp = explode('=', $value);
             if (!empty($tmp)) {
                 $result_arr[$tmp[0]] = $tmp[1];
             }
         }
     }
     if ($type == 'normal') {
         //整理數據返回
         $pay_status = 'N';
         if ($result_arr['r1_Code'] == 50) {
             $pay_status = 'N';
         }
         switch ($result_arr['rb_PayStatus']) {
             case 'INIT':
                 $pay_status = 'P';
                 break;
             case 'CANCELED':
                 $pay_status = 'F';
                 break;
             case 'SUCCESS':
                 $pay_status = 'Y';
                 break;
             default:
                 $pay_status = 'N';
                 break;
         }
         $return_array = array('status' => '1', 'succMoney' => $result_arr['r3_Amt'], 'TransID' => $result_arr['r6_Order'] != '' ? $result_arr['r6_Order'] : $trans_no, 'SuccTime' => $result_arr['ry_FinshTime'], 'CheckResult' => $pay_status);
         return $return_array;
     } else {
         if ($type == 'all') {
             return $result_arr;
         }
     }
 }
開發者ID:shuai959980629,項目名稱:TTDV1,代碼行數:50,代碼來源:Pay.php

示例7: HttpClient

<?php

include_once 'HttpClient.class.php';
$Client = new HttpClient("mssms.cn:8000");
$auth_code = rand(1000, 9999);
$params = array('username' => "JSMB260519", 'scode' => "321791", 'mobile' => "15800651149", 'content' => "@1@={$auth_code}", 'tempid' => "MB-2013102300");
$url = "http://www.mssms.cn:8000/msm/sdk/http/sendsms.jsp";
$pageContents = HttpClient::quickPost($url, $params);
echo "=" . $pageContents;
開發者ID:carriercomm,項目名稱:MyHome,代碼行數:9,代碼來源:sendSms.php

示例8: HmacMd5

$sbOld = $sbOld . $p1_MerId;
#	加入易寶支付交易流水號
$sbOld = $sbOld . $pb_TrxId;
#	加入退款金額
$sbOld = $sbOld . $p3_Amt;
#	加入交易幣種
$sbOld = $sbOld . $p4_Cur;
#	加入退款說明
$sbOld = $sbOld . $p5_Desc;
$hmac = null;
$hmac = HmacMd5($sbOld, $merchantKey);
logstr($pb_TrxId, $sbOld, HmacMd5($sbOld, $merchantKey));
#	進行簽名處理,一定按照文檔中標明的簽名順序進行
#	加入訂單查詢請求,固定值"QueryOrdDetail"
$params = array('p0_Cmd' => $p0_Cmd, 'p1_MerId' => $p1_MerId, 'pb_TrxId' => $pb_TrxId, 'p3_Amt' => $p3_Amt, 'p4_Cur' => $p4_Cur, 'p5_Desc' => $p5_Desc, 'hmac' => $hmac);
$pageContents = HttpClient::quickPost($reqURL_RefOrd, $params);
$result = explode("\n", $pageContents);
## 聲明查詢結果
$r0_Cmd = "";
#	業務類型
$r1_Code = "";
#	退款申請結果
$r2_TrxId = "";
#	易寶支付交易流水號
$r3_Amt = "";
#	退款金額
$r4_Cur = "";
#	交易幣種
$hmac = "";
#	簽名數據
#echo "result.count:".count($result);
開發者ID:NoobSkie,項目名稱:taobao-shop-helper,代碼行數:31,代碼來源:refundOrd.php

示例9: HmacMd5

$QueryOrdURL_onLine = "http://tech.yeepay.com:8080/robot/debug.action";
#	進行簽名處理,一定按照文檔中標明的簽名順序進行
$sbOld = "";
#	加入訂單查詢請求,固定值"QueryOrdDetail"
$sbOld = $sbOld . $p0_Cmd;
#	加入商戶編號
$sbOld = $sbOld . $p1_MerId;
#	加入商戶訂單號
$sbOld = $sbOld . $p2_Order;
$hmac = null;
$hmac = HmacMd5($sbOld, $merchantKey);
logstr($p2_Order, $sbOld, HmacMd5($sbOld, $merchantKey));
#	進行簽名處理,一定按照文檔中標明的簽名順序進行
#	加入訂單查詢請求,固定值"QueryOrdDetail"
$params = array('p0_Cmd' => $p0_Cmd, 'p1_MerId' => $p1_MerId, 'p2_Order' => $p2_Order, 'hmac' => $hmac);
$pageContents = HttpClient::quickPost($QueryOrdURL_onLine, $params);
$result = explode("\n", $pageContents);
## 聲明查詢結果
$r0_Cmd = "";
#	取得業務類型
$r1_Code = "";
#	查詢結果狀態碼
$r2_TrxId = "";
#	易寶支付交易流水號
$r3_Amt = "";
#	支付金額
$r4_Cur = "";
#	交易幣種
$r5_Pid = "";
#	商品名稱
$r6_Order = "";
開發者ID:NoobSkie,項目名稱:taobao-shop-helper,代碼行數:31,代碼來源:queryOrd.php

示例10: createOrder

 /**
  * Wechat::createorder()
  * 生成預支付訂單
  * @param array $access_token
  * @param array $parameter
  * @return array
  */
 public function createOrder($access_token, $parameter)
 {
     $url = 'https://api.weixin.qq.com/pay/genprepay?access_token=' . $access_token;
     $params = array('appid' => $this->wechat_config['app_id'], 'traceid' => '', 'noncestr' => uniqid(), 'package' => $this->buildPackage($parameter), 'timestamp' => time());
     //用於之後的手機喚起 sign
     $this->wechat_noncestr = $params['noncestr'];
     $this->wechat_time = $params['timestamp'];
     $params['app_signature'] = $this->buildSign($params);
     $params['sign_method'] = 'sha1';
     $result = HttpClient::quickPost($url, json_encode($params));
     return json_decode($result, true);
 }
開發者ID:YouthAndra,項目名稱:huaitaoo2o,代碼行數:19,代碼來源:wechatAPISDK.php

示例11: sendsmsbyfeikuo

function sendsmsbyfeikuo($mobile, $content)
{
    Vendor('HttpClient.HttpClient');
    //include_once('HttpClient.php');
    //目標主機的地址,我這裏填上測試的地址
    $Client = new \vendor\HttpClient\HttpClient("mssms.cn:8000");
    $url = "http://mssms.cn:8000/msm/sdk/http/sendsms.jsp";
    //請求的頁麵地址
    //POST的參數
    $params = array('username' => "NTY105029", 'scode' => "1111111", 'mobile' => $mobile, 'content' => $content, 'tempid' => "MB-2013102300");
    $pageContents = \HttpClient::quickPost($url, $params);
    return $pageContents;
}
開發者ID:a1357479,項目名稱:techan,代碼行數:13,代碼來源:function.php

示例12: var_dump

<?php

include 'HttpClient.class.php';
//抓取頁麵的內容
$contents = HttpClient::quickGet('http://www.baidu.com/');
var_dump($contents);
//post請求某一個接口,返回的信息賦值給$res
$res = HttpClient::quickPost('http://example.com/sms.php', array('name' => 'kevin.liu', 'phone' => '18201042042'));
//可能有一些請求訪問會出問題,則需要加一個userAgent
$client = new HttpClient('example.com');
$client->setDebug(true);
$client->setUserAgent('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021207');
if (!$client->get('/')) {
    die('An error occurred: ' . $client->getError());
}
$contents = $client->getContent();
//還有一些情況是:在采集數據的時候必須先登陸,則可以先模擬登陸
$client = new HttpClient('example.com');
$client->post('/login.php', array('username' => 'kevin', 'password' => '123456'));
if (!$client->get('/private.php')) {
    //采集數據的目標地址
    die('An error occurred: ' . $client->getError());
}
$pageContents = $client->getContent();
開發者ID:Applaction,項目名稱:restTool,代碼行數:24,代碼來源:demo2.php

示例13: to_NodeJS_notice

/**
 * 到Node.JS消息通知接口
 * 
 * @param type $url
 * @param type $msgType
 * @param type $targetId
 * @param type $body
 * @return type
 */
function to_NodeJS_notice($data)
{
    $return_arr = HttpClient::quickPost(_NODE_SERVER_URL, $data);
    return $return_arr[1];
}
開發者ID:yonglinchen,項目名稱:shopping,代碼行數:14,代碼來源:fun.php

示例14: BindPhone

 public function BindPhone($mobile)
 {
     $url = $this->bindphoneuri;
     $openid = $this->GetOpenID();
     $params = array('op' => $openid, 'mobile' => $mobile);
     $str = \HttpClient::quickPost($url, $params);
     $json_obj = json_decode(trim($str, chr(239) . chr(187) . chr(191)));
     $code = $json_obj->code;
     if ($code == "0") {
         return true;
     } else {
         $error = $json_obj->error;
         return $error;
     }
 }
開發者ID:misszero,項目名稱:passportsdkphp,代碼行數:15,代碼來源:riceappsdk.php


注:本文中的HttpClient::quickPost方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。