Class HttpConfiguration
java.lang.Object
com.launchdarkly.sdk.android.subsystems.HttpConfiguration
Encapsulates top-level HTTP configuration that applies to all SDK components.
Use HttpConfigurationBuilder
to construct an instance.
The SDK's built-in components use OkHttp as the HTTP client implementation, but since OkHttp types are not surfaced in the public API and custom components might use some other implementation, this class only provides the properties that would be used to create an HTTP client; it does not create the client itself. SDK implementation code uses its own helper methods to do so.
- Since:
- 3.3.0
-
Constructor Summary
ConstructorDescriptionHttpConfiguration
(int connectTimeoutMillis, Map<String, String> defaultHeaders, LDHeaderUpdater headerTransform, boolean useReport) Creates an instance. -
Method Summary
Modifier and TypeMethodDescriptionint
The connection timeout.Returns the basic headers that should be added to all HTTP requests from SDK components to LaunchDarkly services, based on the current SDK configuration.Returns the callback for modifying request headers, if any.boolean
The setting for whether to use the HTTP REPORT method.
-
Constructor Details
-
HttpConfiguration
public HttpConfiguration(int connectTimeoutMillis, Map<String, String> defaultHeaders, LDHeaderUpdater headerTransform, boolean useReport) Creates an instance.- Parameters:
connectTimeoutMillis
- seegetConnectTimeoutMillis()
defaultHeaders
- seegetDefaultHeaders()
headerTransform
- seegetHeaderTransform()
useReport
- seeisUseReport()
-
-
Method Details
-
getConnectTimeoutMillis
public int getConnectTimeoutMillis()The connection timeout. This is the time allowed for the underlying HTTP client to connect to the LaunchDarkly server.- Returns:
- the connection timeout in milliseconds
-
getDefaultHeaders
Returns the basic headers that should be added to all HTTP requests from SDK components to LaunchDarkly services, based on the current SDK configuration.- Returns:
- a list of HTTP header names and values
-
getHeaderTransform
Returns the callback for modifying request headers, if any.- Returns:
- the callback for modifying request headers
-
isUseReport
public boolean isUseReport()The setting for whether to use the HTTP REPORT method.- Returns:
- true to use HTTP REPORT
-