Package dev.resms.core.net.impl
Class HttpClient
java.lang.Object
dev.resms.core.net.impl.HttpClient
- All Implemented Interfaces:
IHttpClient<okhttp3.Response>
An implementation of the
IHttpClient interface for performing HTTP requests. This
implementation uses the OkHttp library for handling HTTP communication.-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionperform(String path, String apiKey, HttpMethod method, String payload) Performs an HTTP request with the specified path, HTTP method, and payload.
-
Field Details
-
BASE_API
The base URL for the API.- See Also:
-
-
Constructor Details
-
HttpClient
public HttpClient()Constructs an instance of the HttpClient.
-
-
Method Details
-
perform
Performs an HTTP request with the specified path, HTTP method, and payload.- Specified by:
performin interfaceIHttpClient<okhttp3.Response>- Parameters:
path- The path or endpoint of the request.apiKey- The API Key used to authenticate the request.method- The HTTP method (GET, POST, PUT, DELETE, etc.).payload- The payload or data to send with the request.- Returns:
- An
AbstractHttpResponserepresenting the response from the server.
-