当前位置: 首页>>代码示例>>PHP>>正文


PHP Varien_Http_Client::setParameterGet方法代码示例

本文整理汇总了PHP中Varien_Http_Client::setParameterGet方法的典型用法代码示例。如果您正苦于以下问题:PHP Varien_Http_Client::setParameterGet方法的具体用法?PHP Varien_Http_Client::setParameterGet怎么用?PHP Varien_Http_Client::setParameterGet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Varien_Http_Client的用法示例。


在下文中一共展示了Varien_Http_Client::setParameterGet方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: license

 /**
  * license the app
  * 
  */
 public static function license($activationKey, $productToken)
 {
     $url = 'https://ls.amazonaws.com/';
     $client = new Varien_Http_Client($url);
     $client->setMethod(Zend_Http_Client::GET);
     $client->setParameterGet("Action", "ActivateDesktopProduct");
     $client->setParameterGet("ActivationKey", $activationKey);
     $client->setParameterGet("ProductToken", $productToken);
     $response = $client->request();
     if ($response->isSuccessful()) {
         $body = $response->getRawBody();
         $xml = new SimpleXMLElement($body);
         $result = array();
         $result["access"] = $xml->ActivateDesktopProductResult->AWSAccessKeyId;
         $result["secret"] = $xml->ActivateDesktopProductResult->SecretAccessKey;
         $result["usertoken"] = $xml->ActivateDesktopProductResult->UserToken;
         // uncomment to debug raw submission response
         //Mage::log("result=" . print_r($result,true));
         return $result;
     } else {
         Mage::log("Activation failed to URL: " . $url . ", HTTP response code was not 200");
         Mage::log("Raw response: " . print_r($response, true));
         return false;
     }
 }
开发者ID:rjocoleman,项目名称:Magento-Cloud-Backup,代码行数:29,代码来源:DevPay.php

示例2: request

 /**
  * Send the HTTP request and return an HTTP response object
  *
  * @param string $url
  * @param Varien_Object $data
  * @param string $method
  * @return Varien_Object
  */
 public function request($url, Varien_Object $data, $method = 'GET')
 {
     $client = new Varien_Http_Client($url, array('timeout' => 30));
     $client->setMethod($method);
     if ($method == Zend_Http_Client::POST) {
         $client->setParameterPost($this->_parseArray($data));
     } else {
         $client->setParameterGet($this->_parseArray($data));
     }
     $response = $client->request();
     $body = json_decode($response->getBody(), true);
     $result = $this->_parseObject($body);
     return $result;
 }
开发者ID:Hospeed,项目名称:pagarme-magento,代码行数:22,代码来源:Api.php

示例3: _postRequest

 protected function _postRequest($request)
 {
     $client = new Varien_Http_Client();
     $client->setUri($this->getUrl());
     $client->setConfig(array('maxredirects' => 2, 'timeout' => 60));
     $client->setParameterGet($request);
     $client->setMethod(Zend_Http_Client::GET);
     try {
         $response = $client->request();
     } catch (Exception $e) {
         Mage::throwException(Mage::helper('pnsofortueberweisung')->__('Gateway request error: %s', $e->getMessage()));
     }
     $responseBody = $response->getBody();
     return $responseBody;
 }
开发者ID:jronatay,项目名称:ultimo-magento-jron,代码行数:15,代码来源:Paycode.php


注:本文中的Varien_Http_Client::setParameterGet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。