Package com.vonage.client
Class HttpWrapper
java.lang.Object
com.vonage.client.HttpWrapper
Internal class that holds available authentication methods and a shared HttpClient.
-
Constructor Summary
ConstructorsConstructorDescriptionHttpWrapper(AuthCollection authCollection) HttpWrapper(AuthMethod... authMethods) HttpWrapper(HttpConfig httpConfig, AuthCollection authCollection) HttpWrapper(HttpConfig httpConfig, AuthMethod... authMethods) -
Method Summary
Modifier and TypeMethodDescriptionprotected org.apache.http.impl.client.CloseableHttpClientReturns the API key if it was set when creating the client.Returns the application ID if it was set when creating the client.Gets the authentication settings used by the client.Gets the SDK version.org.apache.http.impl.client.CloseableHttpClientGets the underlyingHttpClientinstance used by the SDK.Gets the HTTP configuration settings for the client.Gets theUser-Agentheader to be used in HTTP requests.voidsetAuthCollection(AuthCollection authCollection) Deprecated.voidsetHttpClient(org.apache.http.client.HttpClient httpClient) Deprecated.voidsetHttpConfig(HttpConfig httpConfig) Deprecated.
-
Constructor Details
-
HttpWrapper
-
HttpWrapper
-
HttpWrapper
-
HttpWrapper
-
-
Method Details
-
getHttpClient
Gets the underlyingHttpClientinstance 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
nullif unavailable. - Since:
- 8.9.0
-
getApiKey
Returns the API key if it was set when creating the client.- Returns:
- The API key, or
nullif unavailable. - Since:
- 8.9.0
-
setHttpClient
Deprecated. -
setHttpConfig
Deprecated. -
getAuthCollection
Gets the authentication settings used by the client.- Returns:
- The available authentication methods object.
-
setAuthCollection
Deprecated. -
createHttpClient
-
getHttpConfig
Gets the HTTP configuration settings for the client.- Returns:
- The request configuration settings object.
-
getUserAgent
Gets theUser-Agentheader 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
-