Skip to content

Commit

Permalink
Send standard user agent for php client API requests.
Browse files Browse the repository at this point in the history
  • Loading branch information
garthbrantley committed Sep 11, 2022
1 parent bd76329 commit c3005c6
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/SubscribePro/Http.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class Http
*/
public const DEFAULT_LOG_MESSAGE_FORMAT = "{method} - {uri}\nRequest body: {req_body}\n{code} {phrase}\nResponse body: {res_body}\n{error}\n";

/**
* User agent string for outgoing API requests.
*/
public const USER_AGENT = 'subscribepro-php/1.1';

/**
* @var string
*/
Expand Down Expand Up @@ -86,6 +91,9 @@ protected function createClient()
RequestOptions::HTTP_ERRORS => false,
RequestOptions::AUTH => [$this->app->getClientId(), $this->app->getClientSecret()],
RequestOptions::TIMEOUT => $this->requestTimeout,
RequestOptions::HEADERS => [
'User-Agent' => self::USER_AGENT,
]
]);
}

Expand Down

0 comments on commit c3005c6

Please sign in to comment.