diff --git a/src/Api/AbstractApi.php b/src/Api/AbstractApi.php index 95ed1376..5c81d6fd 100644 --- a/src/Api/AbstractApi.php +++ b/src/Api/AbstractApi.php @@ -36,7 +36,7 @@ abstract class AbstractApi * * @var string */ - private const URI_PREFIX = 'api/v4/'; + private const URI_PREFIX = '/api/v4/'; /** * The client instance. diff --git a/src/Client.php b/src/Client.php index 872d8369..4c750d03 100644 --- a/src/Client.php +++ b/src/Client.php @@ -50,7 +50,7 @@ use Gitlab\HttpClient\Plugin\ExceptionThrower; use Gitlab\HttpClient\Plugin\History; use Http\Client\Common\HttpMethodsClientInterface; -use Http\Client\Common\Plugin\AddHostPlugin; +use Http\Client\Common\Plugin\BaseUriPlugin; use Http\Client\Common\Plugin\HeaderDefaultsPlugin; use Http\Client\Common\Plugin\HistoryPlugin; use Http\Client\Common\Plugin\RedirectPlugin; @@ -415,8 +415,8 @@ public function setUrl(string $url): void { $uri = $this->getHttpClientBuilder()->getUriFactory()->createUri($url); - $this->getHttpClientBuilder()->removePlugin(AddHostPlugin::class); - $this->getHttpClientBuilder()->addPlugin(new AddHostPlugin($uri)); + $this->getHttpClientBuilder()->removePlugin(BaseUriPlugin::class); + $this->getHttpClientBuilder()->addPlugin(new BaseUriPlugin($uri)); } /**