Skip to content

Commit 7bde7d8

Browse files
authored
Add User-Agent to requests
1 parent a492bbe commit 7bde7d8

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/OrgManager.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public function joinOrg($id, $username)
135135
*/
136136
protected function get($resource, array $query = [])
137137
{
138-
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken];
138+
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken, 'User-Agent' => 'php-orgmanager-api'];
139139
$data['query'] = $query;
140140
$results = $this->client
141141
->get("{$this->baseUrl}{$resource}", $data)
@@ -153,7 +153,7 @@ protected function get($resource, array $query = [])
153153
*/
154154
protected function post($resource, array $rawdata = [])
155155
{
156-
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken];
156+
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken, 'User-Agent' => 'php-orgmanager-api'];
157157
$data['json'] = $rawdata;
158158
$results = $this->client
159159
->post("{$this->baseUrl}{$resource}", $data)
@@ -171,7 +171,7 @@ protected function post($resource, array $rawdata = [])
171171
*/
172172
protected function put($resource, array $rawdata = [])
173173
{
174-
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken];
174+
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken, 'User-Agent' => 'php-orgmanager-api'];
175175
$data['json'] = $rawdata;
176176
$results = $this->client
177177
->request('PUT', "{$this->baseUrl}{$resource}", $data)
@@ -189,7 +189,7 @@ protected function put($resource, array $rawdata = [])
189189
*/
190190
public function delete($resource, array $rawdata = [])
191191
{
192-
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken];
192+
$data['headers'] = ['Authorization' => 'Bearer '.$this->apiToken, 'User-Agent' => 'php-orgmanager-api'];
193193
$data['json'] = $rawdata;
194194
$results = $this->client
195195
->request('DELETE', "{$this->baseUrl}{$resource}", $data)

0 commit comments

Comments
 (0)