Skip to content

Commit

Permalink
Adding User-Agent with version information to the headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Maarten Bremer committed May 6, 2016
1 parent 48c3647 commit 46e8b5d
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

class Client {
const BASE_URI = 'https://api.xolphin.com/v%d/';
const VERSION = 1;
const API_VERSION = 1;
const VERSION = '1.1';

private $username = '';
private $password = '';
Expand All @@ -25,18 +26,18 @@ function __construct($username, $password) {
$this->password = $password;

$options = [
'base_uri' => sprintf(Client::BASE_URI, Client::VERSION),
'base_uri' => sprintf(Client::BASE_URI, Client::API_VERSION),
'auth' => [$this->username, $this->password],
'headers' => [
'Accept' => 'application/json'
'Accept' => 'application/json',
'User-Agent' => 'xolphin-api-php/'. Client::VERSION
]
];
if(getenv('TEST_PROXY') !== FALSE) {
$options['proxy'] = getenv('TEST_PROXY');
$options['verify'] = false;
}
$this->guzzle = new \GuzzleHttp\Client($options);

}

/**
Expand Down

0 comments on commit 46e8b5d

Please sign in to comment.