Class HttpWrapper

java.lang.Object
com.vonage.client.HttpWrapper

public class HttpWrapper extends Object
Internal class that holds available authentication methods and a shared HttpClient.
  • Constructor Details

  • Method Details

    • getHttpClient

      public org.apache.http.impl.client.CloseableHttpClient getHttpClient()
      Gets the underlying HttpClient instance used by the SDK.
      Returns:
      The Apache HTTP client instance.
    • getApplicationId

      Returns the application ID if it was set when creating the client.
      Returns:
      The application ID, or null if unavailable.
      Since:
      8.9.0
    • getApiKey

      public String getApiKey()
      Returns the API key if it was set when creating the client.
      Returns:
      The API key, or null if unavailable.
      Since:
      8.9.0
    • setHttpClient

      @Deprecated public void setHttpClient(org.apache.http.client.HttpClient httpClient)
      Deprecated.
    • setHttpConfig

      @Deprecated public void setHttpConfig(HttpConfig httpConfig)
      Deprecated.
    • getAuthCollection

      Gets the authentication settings used by the client.
      Returns:
      The available authentication methods object.
    • setAuthCollection

      @Deprecated public void setAuthCollection(AuthCollection authCollection)
      Deprecated.
    • createHttpClient

      protected org.apache.http.impl.client.CloseableHttpClient createHttpClient()
    • getHttpConfig

      Gets the HTTP configuration settings for the client.
      Returns:
      The request configuration settings object.
    • getUserAgent

      public String getUserAgent()
      Gets the User-Agent header to be used in HTTP requests. This includes the Java runtime and SDK version, as well as the custom user agent string, if present.
      Returns:
      The user agent string.
    • getClientVersion

      Gets the SDK version.
      Returns:
      The SDK version as a string.
      Since:
      8.11.0