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


PHP Google_Http_REST::execute方法代码示例

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


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

示例1: execute

 /**
  * Helper method to execute deferred HTTP requests.
  *
  * @returns object of the type of the expected class or array.
  */
 public function execute()
 {
     $this->maybeMoveParametersToBody();
     return Google_Http_REST::execute($this->client, $this);
 }
开发者ID:nabble,项目名称:ajde,代码行数:10,代码来源:Request.php

示例2: execute

 /**
  * Helper method to execute deferred HTTP requests.
  *
  * @param $request Google_Http_Request|Google_Http_Batch
  * @throws Google_Exception
  * @return object of the type of the expected class or array.
  */
 public function execute($request)
 {
     if ($request instanceof Google_Http_Request) {
         $request->setUserAgent($this->getApplicationName() . " " . self::USER_AGENT_SUFFIX . $this->getLibraryVersion());
         if (!$this->getClassConfig("Google_Http_Request", "disable_gzip")) {
             $request->enableGzip();
         }
         $request->maybeMoveParametersToBody();
         return Google_Http_REST::execute($this, $request);
     } else {
         if ($request instanceof Google_Http_Batch) {
             return $request->execute();
         } else {
             throw new Google_Exception("Do not know how to execute this type of object.");
         }
     }
 }
开发者ID:hzhou9,项目名称:coupon_deal,代码行数:24,代码来源:Client.php

示例3: execute

 /**
  * Helper method to execute deferred HTTP requests.
  *
  * @param $request Psr\Http\Message\RequestInterface|Google_Http_Batch
  * @throws Google_Exception
  * @return object of the type of the expected class or Psr\Http\Message\ResponseInterface.
  */
 public function execute(RequestInterface $request, $expectedClass = null)
 {
     $request = $request->withHeader('User-Agent', $this->config['application_name'] . " " . self::USER_AGENT_SUFFIX . $this->getLibraryVersion());
     // call the authorize method
     // this is where most of the grunt work is done
     $http = $this->authorize();
     return Google_Http_REST::execute($http, $request, $expectedClass, $this->config['retry']);
 }
开发者ID:branJakJak,项目名称:dienSiSystem,代码行数:15,代码来源:Client.php

示例4: makeRequest

 /**
  * Runs the defined request.
  *
  * @return array
  */
 private function makeRequest()
 {
     $request = new Google_Http_Request('/test');
     $io = $this->getMockBuilder('Google_IO_Abstract')->disableOriginalConstructor()->setMethods(array('makeRequest'))->getMockForAbstractClass();
     $io->expects($this->exactly($this->mockedCallsCount))->method('makeRequest')->will($this->returnCallback(array($this, 'getNextMockedCall')));
     $this->client->setIo($io);
     return Google_Http_REST::execute($this->client, $request);
 }
开发者ID:imonroe,项目名称:coldreader,代码行数:13,代码来源:TaskTest.php

示例5: execute

 /**
  * Helper method to execute deferred HTTP requests.
  *
  * @param $request Google_Http_Request|Google_Http_Batch
  * @throws Google_Exception
  * @return object of the type of the expected class or array.
  */
 public function execute($request)
 {
     if ($request instanceof Google_Http_Request) {
         $request->setUserAgent($this->getApplicationName() . " " . self::USER_AGENT_SUFFIX . $this->getLibraryVersion());
         if (!$this->getClassConfig("Google_Http_Request", "disable_gzip")) {
             $request->enableGzip();
         }
         $request->maybeMoveParametersToBody();
         return Google_Http_REST::execute($this, $request);
     } else {
         if ($request instanceof Google_Http_Batch) {
             return $request->execute();
         } else {
             //throw new Google_Exception("Do not know how to execute this type of object.");
             echo json_encode(array('status' => FALSE, 'response-code' => 400, 'response' => "Do not know how to execute this type of object.", 'message' => ''));
             die;
         }
     }
 }
开发者ID:lo-lk-org,项目名称:LO_LK_V1,代码行数:26,代码来源:Client.php

示例6: execute

 /**
  * Helper method to execute deferred HTTP requests.
  *
  * @param $request GuzzleHttp\Message\RequestInterface|Google_Http_Batch
  * @throws Google_Exception
  * @return object of the type of the expected class or array.
  */
 public function execute($request, $expectedClass = null)
 {
     $request->setHeader('User-Agent', $this->config->get('application_name') . " " . self::USER_AGENT_SUFFIX . $this->getLibraryVersion());
     $http = $this->getHttpClient();
     $result = Google_Http_REST::execute($http, $request, $this->config['retry']);
     $expectedClass = $expectedClass ?: $request->getHeader('X-Php-Expected-Class');
     if ($expectedClass) {
         $result = new $expectedClass($result);
     }
     return $result;
 }
开发者ID:rrgraute,项目名称:google-api-php-client,代码行数:18,代码来源:Client.php

示例7: makeRequest

 /**
  * Runs the defined request.
  *
  * @return array
  */
 private function makeRequest()
 {
     $request = new Request('GET', '/test');
     $http = $this->getMock('GuzzleHttp\\ClientInterface');
     $http->expects($this->exactly($this->mockedCallsCount))->method('send')->will($this->returnCallback(array($this, 'getNextMockedCall')));
     return Google_Http_REST::execute($http, $request, $this->retryConfig, $this->retryMap);
 }
开发者ID:OlivierBarbier,项目名称:google-api-php-client,代码行数:12,代码来源:RunnerTest.php


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