本文整理汇总了PHP中CHTTP::Post方法的典型用法代码示例。如果您正苦于以下问题:PHP CHTTP::Post方法的具体用法?PHP CHTTP::Post怎么用?PHP CHTTP::Post使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHTTP
的用法示例。
在下文中一共展示了CHTTP::Post方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: MultySend
function MultySend($arNumbers, $message)
{
if (!empty($arNumbers)) {
if (!defined("BX_UTF")) {
$message = iconv("windows-1251", "utf-8", $message);
}
$res = new CHTTP();
$token = $res->Get("http://sms.ru/auth/get_token");
$arrep = array(" ", ",", "(", ")", "-");
foreach ($arNumbers as $k => $v) {
$arNumbers[$k] = str_replace($arrep, "", $v);
}
$arr = array("login" => COption::GetOptionString("echogroup.smsru", "LOGIN"), "sha512" => hash("sha512", COption::GetOptionString("echogroup.smsru", "PASSWORD") . $token . COption::GetOptionString("echogroup.smsru", "API_KEY")), "token" => $token, "to" => implode($arNumbers, $number), "text" => $message);
$html = $res->Post("http://sms.ru/sms/send", $arr);
return $html;
}
}
示例2: _query
private function _query($method, $params = array())
{
global $APPLICATION;
if ($this->arLink)
{
if (!$method)
$method = 'lead.add';
$arPostFields = array(
'method' => $method
);
if ($this->arAuth)
{
$arPostFields['LOGIN'] = $this->arAuth['LOGIN'];
$arPostFields['PASSWORD'] = $this->arAuth['PASSWORD'];
}
else
{
$arPostFields['AUTH'] = $this->arLink['AUTH_HASH'];
}
$arPostFields = array_merge($params, $arPostFields);
$arPostFields = $APPLICATION->ConvertCharsetArray($arPostFields, LANG_CHARSET, 'UTF-8');
$obHTTP = new CHTTP();
$result_text = $obHTTP->Post($this->arLink['URL'], $arPostFields);
$version_header = $obHTTP->headers['X-CRM-Version'];
if (strlen($version_header) <= 0 || version_compare($version_header, "11.5.0") < 0)
{
$result_text = '{"error":"500","error_message":"'.GetMessage('FORM_CRM_VERSION_FAILURE').'"}';
}
else
{
$result_text = $APPLICATION->ConvertCharset($result_text, 'UTF-8', LANG_CHARSET);
}
$this->lastResult = new _CFormCrmSenderResult($result_text);
if ($this->lastResult->field('AUTH'))
{
$this->_setAuthHash($this->lastResult->field('AUTH'));
}
return $this->lastResult;
}
return false;
}
示例3: sendRequest
/**
* Send request to Bitrix (check o receive)
* @param array $pPayload
* @return array|bool
*/
protected static function sendRequest(array $pPayload)
{
$request = new CHTTP();
$request->http_timeout = self::CONNECTION_TIMEOUT;
$request->setFollowRedirect(true);
@$request->Post(self::getCheckerUrl(), $pPayload);
if($request->status === 200 && $request->result)
{
return self::decodeResponse($request->result);
}
else
{
return false;
}
}
示例4: sPost
public static function sPost($url, $arPostData, $follow_redirect = false) //static post
{
$ob = new CHTTP();
$ob->setFollowRedirect($follow_redirect);
return $ob->Post($url, $arPostData);
}
示例5: SendBatch
public function SendBatch($batch)
{
require_once $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/classes/general/update_client.php";
$key = CUpdateClient::GetLicenseKey();
if (strlen($key) > 0 && strlen($batch) > 0) {
$request = new CHTTP();
$arPostData = array("Action" => "SendMessage", "MessageBody" => $batch);
$response = $request->Post(self::$remoteProviderUrl . "?key=" . md5($key), $arPostData);
return $response;
}
return false;
}
示例6: OnModuleInstalledEvent
}
die();
}
elseif($_POST["act"] == "add_opinion")
{
$arF = Array(
"comments" => $GLOBALS["APPLICATION"]->ConvertCharset($_POST["comments"], SITE_CHARSET, "windows-1251"),
"lkey" => md5("FREETRIX".CUpdateClientPartner::GetLicenseKey()."LICENCE"),
"act" => "add_delete_comment",
"name" => $GLOBALS["APPLICATION"]->ConvertCharset($USER->GetFullName(), SITE_CHARSET, "windows-1251"),
"email" => $USER->GetEmail(),
"reason" => $_POST["reason"],
);
$ht = new CHTTP();
$ht->Post("https://marketplace.1c-freetrix.ru/solutions/".$moduleId."/", $arF);
LocalRedirect($APPLICATION->GetCurPage()."?lang=".LANGUAGE_ID."&result=OPAD");
}
}
}
$arModules = array();
function OnModuleInstalledEvent($id, $installed, $Module)
{
foreach(GetModuleEvents("main", "OnModuleInstalled", true) as $arEvent)
{
ExecuteModuleEventEx($arEvent, array($id, $installed));
}
$cModules = COption::GetOptionString("main", "mp_modules_date", "");
$arModules = array();
示例7: batch
public function batch($actions)
{
$arBatch = array();
if(is_array($actions))
{
foreach($actions as $query_key => $arCmd)
{
list($cmd, $arParams) = array_values($arCmd);
$arBatch['cmd'][$query_key] = $cmd.'?'.CHTTP::PrepareData($arParams);
}
}
$arBatch['auth'] = $this->access_token;
$batch_url = '/rest/batch';
$ht = new CHTTP();
$result = $ht->Post($this->portalURI.$batch_url, $arBatch);
return $this->prepareAnswer($result);
}
示例8: payOrder
function payOrder()
{
if (strlen($this->token) > 0) {
$url = "https://api-3t." . $this->domain . "paypal.com/nvp";
$arFields = array("METHOD" => "GetExpressCheckoutDetails", "VERSION" => $this->version, "USER" => $this->username, "PWD" => $this->pwd, "SIGNATURE" => $this->signature, "TOKEN" => $this->token);
$ht = new CHTTP();
if ($res = $ht->Post($url, $arFields)) {
$result = $this->parseResult($res);
if ($result["ACK"] == "Success" && in_array($result["CHECKOUTSTATUS"], array("PaymentActionNotInitiated"))) {
$arFields["METHOD"] = "DoExpressCheckoutPayment";
$arFields["PAYERID"] = $this->payerId;
$arFields["PAYMENTACTION"] = "Sale";
$arFields["AMT"] = $this->orderAmount;
$arFields["CURRENCYCODE"] = $this->currency;
$arFields["DESC"] = "Order #" . $this->orderId;
if ($res2 = $ht->Post($url, $arFields)) {
$result2 = $this->parseResult($res2);
if ($result2["ACK"] == "Success" && $result2["PAYMENTSTATUS"] == "Completed") {
CSaleOrder::PayOrder($this->orderId, "Y");
$strPS_STATUS_MESSAGE = "";
$strPS_STATUS_MESSAGE .= "Name: " . $result["FIRSTNAME"] . " " . $result["LASTNAME"] . "; ";
$strPS_STATUS_MESSAGE .= "Email: " . $result["EMAIL"] . "; ";
$strPS_STATUS_DESCRIPTION = "";
$strPS_STATUS_DESCRIPTION .= "Payment status: " . $result2["PAYMENTSTATUS"] . "; ";
$strPS_STATUS_DESCRIPTION .= "Payment sate: " . $result2["ORDERTIME"] . "; ";
$arOrderFields = array("PS_STATUS" => "Y", "PS_STATUS_CODE" => "-", "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $result2["AMT"], "PS_CURRENCY" => $result2["CURRENCYCODE"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "PAY_VOUCHER_NUM" => $result2["TRANSACTIONID"], "PAY_VOUCHER_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
} else {
$strPS_STATUS_MESSAGE = "";
$strPS_STATUS_MESSAGE .= "Name: " . $result["FIRSTNAME"] . " " . $result["LASTNAME"] . "; ";
$strPS_STATUS_MESSAGE .= "Email: " . $result["EMAIL"] . "; ";
$strPS_STATUS_DESCRIPTION = "";
$strPS_STATUS_DESCRIPTION .= "Payment status: " . $result2["PAYMENTSTATUS"] . "; ";
$strPS_STATUS_DESCRIPTION .= "Pending reason: " . $result2["PENDINGREASON"] . "; ";
$strPS_STATUS_DESCRIPTION .= "Payment sate: " . $result2["ORDERTIME"] . "; ";
$arOrderFields = array("PS_STATUS" => "N", "PS_STATUS_CODE" => $result2["PAYMENTSTATUS"], "PS_STATUS_DESCRIPTION" => $strPS_STATUS_DESCRIPTION, "PS_STATUS_MESSAGE" => $strPS_STATUS_MESSAGE, "PS_SUM" => $result2["AMT"], "PS_CURRENCY" => $result2["CURRENCYCODE"], "PS_RESPONSE_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))), "PAY_VOUCHER_NUM" => $result2["TRANSACTIONID"], "PAY_VOUCHER_DATE" => Date(CDatabase::DateFormatToPHP(CLang::GetDateFormat("FULL", LANG))));
}
CSaleOrder::Update($this->orderId, $arOrderFields);
}
}
}
}
}