當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。