public abstract class HttpClient extends Object
| Constructor and Description |
|---|
HttpClient(UserAgent userAgent,
String apiKey)
Creates a new instance of the client.
|
HttpClient(UserAgent userAgent,
String baseUrl,
String apiKey)
Creates a new instance of the client.
|
HttpClient(UserAgent userAgent,
String baseUrl,
String apiKey,
long timeout)
Creates a new instance of the client.
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<okhttp3.Request.Builder> |
connect(String url)
Creates a new connection to the API.
|
CompletableFuture<okhttp3.Request.Builder> |
connect(String url,
Map<String,String> queryParams)
Creates a new connection to the API.
|
okhttp3.Response |
execute(okhttp3.Request.Builder connection)
Executes a request.
|
void |
interceptResponse(okhttp3.Response response)
Intercepts a response.
|
abstract CompletableFuture<Void> |
nextRequest()
Waits for the next request to be allowed.
|
public HttpClient(UserAgent userAgent, String apiKey)
userAgent - The user agent to use.apiKey - The API key to use.public HttpClient(UserAgent userAgent, String baseUrl, String apiKey)
userAgent - The user agent to use.baseUrl - The base URL to use.apiKey - The API key to use.public CompletableFuture<okhttp3.Request.Builder> connect(String url)
url - - The URL to connect to.public CompletableFuture<okhttp3.Request.Builder> connect(String url, Map<String,String> queryParams)
url - - The URL to connect to.queryParams - - The query parameters to use.public okhttp3.Response execute(okhttp3.Request.Builder connection)
throws IOException
connection - - The connection to execute.IOException - If an error occurs.public abstract CompletableFuture<Void> nextRequest()
public void interceptResponse(okhttp3.Response response)
response - - The response to intercept.Copyright © 2026. All rights reserved.