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


PHP ResponseInterface::getEffectiveUrl方法代码示例

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


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

示例1: verifyIfTokenNeedsRefreshing

 protected function verifyIfTokenNeedsRefreshing(ResponseInterface $response, $action, $vars = [])
 {
     if ($response->getStatusCode() != 401) {
         return $response;
     }
     if ($this->tokenChecked) {
         throw new Exception(sprintf('Response could not be obtained due to invalid token and response. Please check your credentials and action: %s', $response->getEffectiveUrl()));
     }
     $this->tokenChecked = true;
     if (file_exists($this->tokenLocation())) {
         unlink($this->tokenLocation());
     }
     return $this->get($action, $vars);
 }
开发者ID:helpfulrobot,项目名称:milkyway-multimedia-ss-infoboxes-wunderlist,代码行数:14,代码来源:Provider.php

示例2: validateResponse

 /**
  * Check if request was successful
  * @param \GuzzleHttp\Message\ResponseInterface $response
  * @throws \UnexpectedValueException
  */
 protected function validateResponse($response)
 {
     if ($response->getStatusCode() !== 200) {
         throw new \UnexpectedValueException('Failed to download ' . $response->getEffectiveUrl() . '. Server responded with ' . $response->getStatusCode() . ' instead of 200.');
     }
 }
开发者ID:drognisep,项目名称:Portfolio-Site,代码行数:11,代码来源:Fetcher.php

示例3: effectiveUrl

 /**
  * Get the effective URL that resulted in this response (e.g. the last
  * redirect URL).
  *
  * @return string
  */
 public function effectiveUrl()
 {
     return $this->response->getEffectiveUrl();
 }
开发者ID:bickart,项目名称:plivo-php,代码行数:10,代码来源:Response.php


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