Package com.azure.core.http.okhttp
Class OkHttpAsyncClientProvider
java.lang.Object
com.azure.core.http.okhttp.OkHttpAsyncClientProvider
- All Implemented Interfaces:
HttpClientProvider
This class provides an OkHttp-based implementation for the HttpClientProvider interface.
It is designed to create instances of HttpClient using OkHttp as the underlying client.
-
Constructor Summary
ConstructorsConstructorDescriptionFor testing purpose only, assigning 'AZURE_ENABLE_HTTP_CLIENT_SHARING' to 'enableHttpClientSharing' for 'final' modifier. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.createInstance(HttpClientOptions clientOptions) Creates a new instance of theHttpClientthat this HttpClientProvider is configured to create.
-
Constructor Details
-
OkHttpAsyncClientProvider
public OkHttpAsyncClientProvider()For testing purpose only, assigning 'AZURE_ENABLE_HTTP_CLIENT_SHARING' to 'enableHttpClientSharing' for 'final' modifier.
-
-
Method Details
-
createInstance
Description copied from interface:com.azure.core.http.HttpClientProviderCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.- Specified by:
createInstancein interfaceHttpClientProvider- Returns:
- A new
HttpClientinstance, entirely unrelated to all other instances that were created previously.
-
createInstance
Description copied from interface:com.azure.core.http.HttpClientProviderCreates a new instance of theHttpClientthat this HttpClientProvider is configured to create.- Specified by:
createInstancein interfaceHttpClientProvider- Parameters:
clientOptions- Configuration options applied to the createdHttpClient.- Returns:
- A new
HttpClientinstance, entirely unrelated to all other instances that were created previously.
-