public class ClientOptions extends Object
Constructor and Description |
---|
ClientOptions() |
Modifier and Type | Method and Description |
---|---|
String |
getApplicationId()
Gets the application ID.
|
Iterable<Header> |
getHeaders()
Gets the
Headers . |
ClientOptions |
setApplicationId(String applicationId)
Sets the application ID.
|
ClientOptions |
setHeaders(Iterable<Header> headers)
Sets the
Headers . |
public String getApplicationId()
public ClientOptions setApplicationId(String applicationId)
The applicationId
is used to configure UserAgentPolicy
for telemetry/monitoring purposes.
See Azure Core: Telemetry policy for additional information.
Code Samples
Create ClientOptions with application ID 'myApplicationId'
ClientOptions clientOptions = new ClientOptions() .setApplicationId("myApplicationId");
applicationId
- The application ID.IllegalArgumentException
- If applicationId
contains spaces or is larger than 24 characters in
length.public ClientOptions setHeaders(Iterable<Header> headers)
Headers
.
The passed headers are applied to each request sent with the client.
This overwrites all previously set headers.
Code Samples
Create ClientOptions with Header 'myCustomHeader':'myStaticValue'
ClientOptions clientOptions = new ClientOptions() .setHeaders(Collections.singletonList(new Header("myCustomHeader", "myStaticValue")));
headers
- The headers.Copyright © 2021 Microsoft Corporation. All rights reserved.