public class OkHttpClientImpl extends Object implements HttpClient
HttpClient.Builder, HttpClient.Factory| Modifier and Type | Field and Description |
|---|---|
static okhttp3.MediaType |
JSON |
static okhttp3.MediaType |
JSON_MERGE_PATCH |
static okhttp3.MediaType |
JSON_PATCH |
static okhttp3.MediaType |
STRATEGIC_MERGE_JSON_PATCH |
| Constructor and Description |
|---|
OkHttpClientImpl(okhttp3.OkHttpClient httpClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
okhttp3.OkHttpClient |
getOkHttpClient() |
HttpClient.Builder |
newBuilder()
Create a builder that starts with the same state as this client
|
HttpRequest.Builder |
newHttpRequestBuilder() |
WebSocket.Builder |
newWebSocketBuilder() |
<T> HttpResponse<T> |
send(HttpRequest request,
Class<T> type)
Send a request an wait for the result
|
<T> CompletableFuture<HttpResponse<T>> |
sendAsync(HttpRequest request,
Class<T> type)
Send an async request
|
public static final okhttp3.MediaType JSON
public static final okhttp3.MediaType JSON_PATCH
public static final okhttp3.MediaType STRATEGIC_MERGE_JSON_PATCH
public static final okhttp3.MediaType JSON_MERGE_PATCH
public void close()
close in interface HttpClientclose in interface AutoCloseablepublic <T> HttpResponse<T> send(HttpRequest request, Class<T> type) throws IOException
HttpClientsend in interface HttpClientT - return typetype - one of InputStream, Reader, StringIOExceptionpublic HttpClient.Builder newBuilder()
HttpClientnewBuilder in interface HttpClientpublic <T> CompletableFuture<HttpResponse<T>> sendAsync(HttpRequest request, Class<T> type)
HttpClientsendAsync in interface HttpClientT - return typetype - one of InputStream, Reader, Stringpublic WebSocket.Builder newWebSocketBuilder()
newWebSocketBuilder in interface HttpClientpublic okhttp3.OkHttpClient getOkHttpClient()
public HttpRequest.Builder newHttpRequestBuilder()
newHttpRequestBuilder in interface HttpClientCopyright © 2015–2022 Red Hat. All rights reserved.