本文整理汇总了PHP中HttpClient::HttpRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP HttpClient::HttpRequest方法的具体用法?PHP HttpClient::HttpRequest怎么用?PHP HttpClient::HttpRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HttpClient
的用法示例。
在下文中一共展示了HttpClient::HttpRequest方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: connectURL
function connectURL($msg)
{
$httpclient = new HttpClient("true", HOST_IP);
$this->printLog("Start INImx_APPL");
$this->printLog("Start HTTP Connect:" . HOST_IP . $this->m_serviceurl);
if ($httpclient->HttpConnect()) {
$this->printLog("HTTP CONNECTION SUCCESS");
if ($httpclient->HttpRequest($this->m_serviceurl, $msg)) {
$this->printLog("RECV REQUEST:" . trim($httpclient->getBody()));
// ���� �� �Ľ�
parse_str(trim($httpclient->getBody()), $resultString);
//����
$this->m_tid = $resultString['P_TID'];
$this->m_resultCode = $resultString['P_STATUS'];
$this->m_resultMsg = $resultString['P_RMESG1'];
$this->m_payMethod = $resultString['P_TYPE'];
$this->m_mid = $resultString['P_MID'];
$this->m_moid = $resultString['P_OID'];
$this->m_resultprice = $resultString['P_AMT'];
$this->m_buyerName = $resultString['P_UNAME'];
$this->m_noti = $resultString['P_NOTI'];
$this->m_nextUrl = $resultString['P_NEXT_URL'];
$this->m_notiUrl = $resultString['P_NOTEURL'];
//�ſ�ī��
$this->m_pgAuthDate = substr($resultString['P_AUTH_DT'], '0', '8');
$this->m_pgAuthTime = substr($resultString['P_AUTH_DT'], '8', '6');
$this->m_authCode = $resultString['P_AUTH_NO'];
$this->m_cardQuota = $resultString['P_RMESG2'];
$this->m_cardCode = $resultString['P_FN_CD1'];
$this->m_cardIssuerCode = $resultString['P_CARD_ISSUER_CODE'];
$this->m_cardNumber = $resultString['P_CARD_NUM'];
$this->m_cardMember = $resultString['P_CARD_MEMBER_NUM'];
$this->m_cardpurchase = $resultString['P_CARD_PURCHASE_CODE'];
$this->m_prtc = $resultString['P_CARD_PRTC_CODE'];
//����
$this->m_codegw = $resultString['P_HPP_CORP'];
//�������
$this->m_vacct = $resultString['P_VACT_NUM'];
$this->m_dtinput = $resultString['P_VACT_DATE'];
$this->m_tminput = $resultString['P_VACT_TIME'];
$this->m_nmvacct = $resultString['P_VACT_NAME'];
$this->m_vcdbank = $resultString['P_VACT_BANK_CODE'];
} else {
$this->printLog("HTTP REQUEST FAIL:" . $httpclient->getErrorCode() . ":" . $httpclient->getErrorMsg());
// �� ���� ��û ����
$this->m_resultCode = "05";
$this->m_resultmsg = "HTTP REQUEST FAIL";
}
} else {
$this->printLog("HTTP CONNECTION FAIL:" . $httpclient->getErrorCode() . ":" . $httpclient->getErrorMsg());
// ���� ���� ����
$this->m_resultCode = "05";
$this->m_resultmsg = "HTTP CONNECTION FAIL";
}
$this->printLog("P_STATUS:" . $this->m_resultCode);
$this->printLog("P_RMESG1:" . $this->m_resultMsg);
$this->printLog("P_TYPE:" . $this->m_payMethod);
$this->printLog("P_TID:" . $this->m_tid);
$this->printLog("P_MID:" . $this->m_mid);
$this->printLog("P_OID:" . $this->m_moid);
$this->printLog("P_UNAME:" . $this->m_buyerName);
$this->printLog("P_AMT:" . $this->m_resultprice);
$this->printLog("P_AUTH_DT:" . $this->m_pgAuthDate);
$this->printLog("P_AUTH_TM:" . $this->m_pgAuthTime);
$this->printLog("P_AUTH_NO:" . $this->m_authCode);
$this->printLog("P_RMESG2:" . $this->m_cardQuota);
$this->printLog("P_FN_CD1:" . $this->m_cardCode);
$this->printLog("P_CARD_ISSUER_CODE:" . $this->m_cardIssuerCode);
$this->printLog("P_CARD_PURCHASE_CODE:" . $this->m_cardpurchase);
$this->printLog("P_CARD_PRTC_CODE:" . $this->m_prtc);
$this->printLog("P_VACT_NUM:" . $this->m_vacct);
$this->printLog("P_VACT_BANK_CODE:" . $this->m_vcdbank);
$this->printLog("P_VACT_DATE:" . $this->m_dtinput);
$this->printLog("P_VACT_TIME:" . $this->m_tminput);
$this->printLog("P_VACT_NAME:" . $this->m_nmvacct);
$this->printLog("P_NEXT_URL:" . $this->m_nextUrl);
$this->printLog("P_NOTEURL:" . $this->m_notiUrl);
$this->printLog("APPL Transaction End");
}
示例2: startAction
//.........这里部分代码省略.........
unset($this->m_queryString);
$this->m_queryString = $_POST;
$this->m_queryString["EncodeKey"] = $this->m_LicenseKey;
$this->m_queryString["TID"] = "";
if ($this->m_charSet == "UTF8") {
$this->m_queryString["BuyerName"] = iconv("UTF-8", "EUC-KR", $this->m_queryString["BuyerName"]);
$this->m_queryString["GoodsName"] = iconv("UTF-8", "EUC-KR", $this->m_queryString["GoodsName"]);
$this->m_queryString["BuyerAddr"] = iconv("UTF-8", "EUC-KR", $this->m_queryString["BuyerAddr"]);
}
}
}
}
}
}
}
}
}
}
$httpclient = new HttpClient($this->m_ssl);
//connect
if (!$httpclient->HttpConnect($NICELog)) {
$NICELog->WriteLog('Server Connect Error!!' . $httpclient->getErrorMsg());
$resultMsg = $httpclient->getErrorMsg() . "서버연결을 할 수가 없습니다.";
if ($this->m_ssl == "true") {
$resultMsg .= "<br>귀하의 서버는 SSL통신을 지원하지 않습니다. 결제처리파일에서 m_ssl=false로 셋팅하고 시도하세오.";
$this->MakeErrorMsg(ERR_SSLCONN, $resultMsg);
} else {
$this->MakeErrorMsg(ERR_CONN, $resultMsg);
}
$NICELog->CloseNiceLog("");
return;
}
//request
if (!$httpclient->HttpRequest($this->m_uri, $this->m_queryString, $NICELog)) {
// 요청 오류시 처리
$NICELog->WriteLog('POST Error!!' . $httpclient->getErrorMsg());
$this->MakeErrorMsg(ERR_NO_RESPONSE, "서버 응답 오류");
//NET CANCEL Start---------------------------------
if ($httpclient->getErrorCode() == READ_TIMEOUT_ERR) {
$NICELog->WriteLog("Net Cancel Start");
$this->m_uri = "/lite/cancelProcess.jsp";
unset($this->m_queryString);
$this->m_queryString["MID"] = substr($this->m_TID, 0, 10);
$this->m_queryString["TID"] = $this->m_TID;
$this->m_queryString["CancelAmt"] = $this->m_NetCancelAmt;
$this->m_queryString["CancelMsg"] = "NICE_NET_CANCEL";
$this->m_queryString["CancelPwd"] = $this->m_NetCancelPW;
$this->m_queryString["NetCancelCode"] = "1";
$NICELog->WriteLog($this->m_queryString["TID"]);
if (!$httpclient->HttpConnect($NICELog)) {
$NICELog->WriteLog('Server Connect Error!!' . $httpclient->getErrorMsg());
$resultMsg = $httpclient->getErrorMsg() . "서버연결을 할 수가 없습니다.";
$this->MakeErrorMsg(ERR_CONN, $resultMsg);
$NICELog->CloseNiceLog($this->m_resultMsg);
return;
}
if (!$httpclient->HttpRequest($this->m_uri, $this->m_queryString, $NICELog) && $httpclient->getErrorCode() == READ_TIMEOUT_ERR) {
$NICELog->WriteLog("Net Cancel FAIL");
if ($this->m_ActionType == "PYO") {
$this->MakeErrorMsg(ERR_NO_RESPONSE, "승인여부 확인요망");
} else {
if ($this->m_ActionType == "CLO") {
$this->MakeErrorMsg(ERR_NO_RESPONSE, "취소여부 확인요망");
}
}
} else {