Class HttpConfiguration

java.lang.Object
com.launchdarkly.sdk.android.subsystems.HttpConfiguration

public final class HttpConfiguration extends Object
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 Details

  • 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

      public Iterable<Map.Entry<String,String>> 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

      public LDHeaderUpdater 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