diff --git a/lib/Tmdb/Client.php b/lib/Tmdb/Client.php index c0afc7ae..228fe6d2 100644 --- a/lib/Tmdb/Client.php +++ b/lib/Tmdb/Client.php @@ -446,6 +446,10 @@ public function setSecure($secure) { $this->secure = $secure; + if ($this->httpClient instanceof HttpClientInterface) { + $this->getHttpClient()->setBaseUrl($this->getBaseUrl()); + } + return $this; } diff --git a/lib/Tmdb/HttpClient/HttpClient.php b/lib/Tmdb/HttpClient/HttpClient.php index 8618e0c3..09e97ccc 100644 --- a/lib/Tmdb/HttpClient/HttpClient.php +++ b/lib/Tmdb/HttpClient/HttpClient.php @@ -237,4 +237,14 @@ public function getLastResponse() { return $this->lastResponse; } + + public function getBaseUrl() + { + return $this->getClient()->getBaseUrl(); + } + + public function setBaseUrl($url) + { + return $this->getClient()->setBaseUrl($url); + } } diff --git a/lib/Tmdb/HttpClient/HttpClientInterface.php b/lib/Tmdb/HttpClient/HttpClientInterface.php index bbce4cbe..a322f29f 100644 --- a/lib/Tmdb/HttpClient/HttpClientInterface.php +++ b/lib/Tmdb/HttpClient/HttpClientInterface.php @@ -99,4 +99,7 @@ public function delete($path, $body = null, array $parameters = array(), array $ * @return Response */ public function request(RequestInterface $request); + + public function getBaseUrl(); + public function setBaseUrl($url); }