Add custom user-agent of all http requests
Closed this issue · 0 comments
dimitrystd commented
We get more and more traffic for FileAPI v2 and looking for an option how to monitor traffic from connectors for quick reaction to errors. The simplest and convenient for all solution to use "User-Agent" header field.
DoD:
- Add to SDK configuration property something like
clientLibId
(this is how we call it in another SDKs) - Add versioning to SDK
- Configuration has format
{sdk name}/{version}
- The default value
clientLibId = smartling-api-sdk-go/{version}
. - Developer who uses our SDK can override
clientLibId
in code (this is what we will do in smartling-cli) - Add
clientLibId
and SDK version as "User-Agent" for all http requests - If you would like to keep the original "User-Agent" too, then add information in the begging of "User-Agent" . An example:
- The original user-agent:
Guzzle/5.3.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.14
- The new user-agent:
smartling-api-sdk-go/1.0.5 Guzzle/5.3.0 curl/7.35.0 PHP/5.5.9-1ubuntu4.14
- The original user-agent: