SetAppInfo adds custom application name and version to the User-Agent header for all requests. This helps identify your application in server logs and metrics. Parameters: - appName: Name of the application - appVersion: Version of the application Both parameters must be non-empty for the custom U
(appName, appVersion string)
| 353 | // |
| 354 | // Both parameters must be non-empty for the custom User-Agent to be set. |
| 355 | func (c *Client) SetAppInfo(appName, appVersion string) { |
| 356 | // if app name and version not set, we do not set a new user agent. |
| 357 | if appName != "" && appVersion != "" { |
| 358 | c.appInfo.appName = appName |
| 359 | c.appInfo.appVersion = appVersion |
| 360 | } |
| 361 | } |
| 362 | |
| 363 | // TraceOn enables HTTP request and response tracing for debugging purposes. |
| 364 | // All HTTP traffic will be written to the provided output stream. |
no outgoing calls