io.apimatic.coreinterfaces.http.HttpClient Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-interfaces Show documentation
Show all versions of core-interfaces Show documentation
An abstract layer of the functionalities provided by apimatic-core-library, okhttp-client-adapter and APIMatic SDKs.
package io.apimatic.coreinterfaces.http;
import java.io.IOException;
import java.util.concurrent.CompletableFuture;
import io.apimatic.coreinterfaces.http.request.Request;
import io.apimatic.coreinterfaces.http.request.configuration.CoreEndpointConfiguration;
import io.apimatic.coreinterfaces.http.response.Response;
/**
* To send HTTP Requests and read the responses.
*/
public interface HttpClient {
/**
* Execute a given Request to get string/binary response back.
* @param request The given HttpRequest to execute.
* @param endpointConfiguration The overridden configuration for request.
* @return CompletableFuture of Response after execution.
*/
CompletableFuture executeAsync(Request request,
CoreEndpointConfiguration endpointConfiguration);
/**
* Execute a given Request to get string/binary response back.
* @param request The given Request to execute.
* @param endpointConfiguration The overridden configuration for request.
* @return The converted response.
* @throws IOException exception to be thrown while converting response.
*/
Response execute(Request request, CoreEndpointConfiguration endpointConfiguration)
throws IOException;
}