public class OkClient extends Object implements io.apimatic.coreinterfaces.http.HttpClient
| Constructor and Description |
|---|
OkClient(io.apimatic.coreinterfaces.http.ClientConfiguration httpClientConfig,
io.apimatic.coreinterfaces.compatibility.CompatibilityFactory compatibilityFactory)
Constructor to initialize the OKClient
|
OkClient(io.apimatic.coreinterfaces.http.ClientConfiguration httpClientConfig,
io.apimatic.coreinterfaces.compatibility.CompatibilityFactory compatibilityFactory,
io.apimatic.coreinterfaces.logger.ApiLogger apiLogger)
Constructor to initialize the OKClient
|
| Modifier and Type | Method and Description |
|---|---|
static io.apimatic.coreinterfaces.http.response.Response |
convertResponse(io.apimatic.coreinterfaces.http.request.Request request,
okhttp3.Response response,
boolean hasBinaryResponse)
Converts a given OkHttp response into our internal http response model.
|
io.apimatic.coreinterfaces.http.response.Response |
execute(io.apimatic.coreinterfaces.http.request.Request httpRequest,
io.apimatic.coreinterfaces.http.request.configuration.CoreEndpointConfiguration endpointConfiguration)
Execute a given Request to get string/binary response back.
|
CompletableFuture<io.apimatic.coreinterfaces.http.response.Response> |
executeAsync(io.apimatic.coreinterfaces.http.request.Request httpRequest,
io.apimatic.coreinterfaces.http.request.configuration.CoreEndpointConfiguration endpointConfiguration)
Execute a given Request to get string/binary response back.
|
static void |
shutdown()
Shutdown the underlying OkHttpClient instance.
|
public OkClient(io.apimatic.coreinterfaces.http.ClientConfiguration httpClientConfig,
io.apimatic.coreinterfaces.compatibility.CompatibilityFactory compatibilityFactory,
io.apimatic.coreinterfaces.logger.ApiLogger apiLogger)
httpClientConfig - client configurationcompatibilityFactory - the compatibilityFactory for backward compatibilityapiLogger - the logger for logging informationpublic OkClient(io.apimatic.coreinterfaces.http.ClientConfiguration httpClientConfig,
io.apimatic.coreinterfaces.compatibility.CompatibilityFactory compatibilityFactory)
httpClientConfig - the httpClientConfigurationcompatibilityFactory - the compatibilityFactory for backward compatibilitypublic static void shutdown()
public CompletableFuture<io.apimatic.coreinterfaces.http.response.Response> executeAsync(io.apimatic.coreinterfaces.http.request.Request httpRequest, io.apimatic.coreinterfaces.http.request.configuration.CoreEndpointConfiguration endpointConfiguration)
executeAsync in interface io.apimatic.coreinterfaces.http.HttpClienthttpRequest - The given Request to execute.endpointConfiguration - The endpointconfiguration for request.public io.apimatic.coreinterfaces.http.response.Response execute(io.apimatic.coreinterfaces.http.request.Request httpRequest,
io.apimatic.coreinterfaces.http.request.configuration.CoreEndpointConfiguration endpointConfiguration)
throws IOException
execute in interface io.apimatic.coreinterfaces.http.HttpClienthttpRequest - The given Request to execute.endpointConfiguration - The endpointConfiguration for request.IOException - exception to be thrown while converting response.public static io.apimatic.coreinterfaces.http.response.Response convertResponse(io.apimatic.coreinterfaces.http.request.Request request,
okhttp3.Response response,
boolean hasBinaryResponse)
throws IOException
request - The given http request in internal format.response - The given OkHttp response.hasBinaryResponse - Whether the response is binary or string.IOException - exception to be thrown while converting response.Copyright © 2022. All rights reserved.