Skip to content

Commit

Permalink
Added handler for base URI API version.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aidan Casey committed Aug 17, 2020
1 parent 54c12e3 commit ec31bd2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions src/HttpClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,12 @@ public function __construct(
string $baseUri
)
{
// This line handles the versioning of the base URL (or the lack of it)
$baseUri = str_replace('/v1.0', '', $baseUri);
$baseUri = rtrim($baseUri, '/');
$baseUri = $baseUri . '/v1.0/';

// Now create the client
$this->client = new GuzzleClient([
'base_uri' => $baseUri,
'headers' => [
Expand Down

0 comments on commit ec31bd2

Please sign in to comment.