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


PHP Request::getClient方法代码示例

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


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

示例1: debug

 public function debug()
 {
     $r = new Response();
     var_dump($r->getReasonPhrase());
     $req = new Request();
     $req->getClient();
 }
开发者ID:arthurwayne,项目名称:ovh-sdk-php,代码行数:7,代码来源:VrackException.php

示例2: addAuthenticationHeaders

 /**
  * Sign the current request for write operations
  *
  * @param Request $request The current request
  */
 private function addAuthenticationHeaders(Request $request)
 {
     $client = $request->getClient();
     // Get a GMT/UTC timestamp
     $timestamp = gmdate('Y-m-d\\TH:i:s\\Z');
     // Build the data to base the hash on
     $data = $request->getMethod() . '|' . $request->getUrl() . '|' . $client->getConfig('publicKey') . '|' . $timestamp;
     // Generate signature
     $signature = hash_hmac('sha256', $data, $client->getConfig('privateKey'));
     // Add relevant request headers (overwriting once that might already exist)
     $request->setHeader('X-Imbo-Authenticate-Signature', $signature);
     $request->setHeader('X-Imbo-Authenticate-Timestamp', $timestamp);
 }
开发者ID:sgulseth,项目名称:imboclient-php,代码行数:18,代码来源:Authenticate.php

示例3: getRequestHistory

 /**
  * 
  * @param \Guzzle\Http\Message\Request $request
  * @return \Guzzle\Plugin\History\HistoryPlugin|null
  */
 private function getRequestHistory(\Guzzle\Http\Message\Request $request)
 {
     $requestSentListeners = $request->getClient()->getEventDispatcher()->getListeners('request.sent');
     foreach ($requestSentListeners as $requestSentListener) {
         if ($requestSentListener[0] instanceof \Guzzle\Plugin\History\HistoryPlugin) {
             return $requestSentListener[0];
         }
     }
     return null;
 }
开发者ID:webignition,项目名称:url-resolver,代码行数:15,代码来源:Resolver.php

示例4: __construct

 /**
  * @param \Guzzle\Http\Message\Request $xml
  */
 public function __construct(Request $request)
 {
     $this->client = $request->getClient();
     $this->xml = $request->send()->xml();
 }
开发者ID:cpliakas,项目名称:bigoven-php,代码行数:8,代码来源:Response.php

示例5: testRequestsManageClients

 /**
  * @covers Guzzle\Http\Message\Request::getClient
  * @covers Guzzle\Http\Message\Request::setClient
  */
 public function testRequestsManageClients()
 {
     $request = new Request('GET', 'http://test.com');
     $this->assertNull($request->getClient());
     $request->setClient($this->client);
     $this->assertSame($this->client, $request->getClient());
 }
开发者ID:idiscussforum,项目名称:providence,代码行数:11,代码来源:RequestTest.php


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