Package org.openqa.selenium.remote.http
Interface HttpClient
- All Superinterfaces:
AutoCloseable,Closeable,HttpHandler
- All Known Implementing Classes:
JdkHttpClient,TracedHttpClient
Defines a simple client for making HTTP requests.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptiondefault voidclose()default CompletableFuture<HttpResponse> executeAsync(HttpRequest req) openSocket(HttpRequest request, WebSocket.Listener listener) <T> CompletableFuture<HttpResponse<T>> sendAsyncNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Deprecated, for removal: This API element is subject to removal in a future version.use JdkHttpClient#httpClient() instead.<T> HttpResponse<T> sendNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Deprecated, for removal: This API element is subject to removal in a future version.use JdkHttpClient#httpClient() instead.Methods inherited from interface org.openqa.selenium.remote.http.HttpHandler
execute, with
-
Method Details
-
openSocket
-
executeAsync
-
close
default void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
sendAsyncNative
@Deprecated(forRemoval=true) <T> CompletableFuture<HttpResponse<T>> sendAsyncNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Deprecated, for removal: This API element is subject to removal in a future version.use JdkHttpClient#httpClient() instead.Sends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.- Type Parameters:
T- the response body type- Parameters:
request- the HTTP request to sendhandler- the BodyHandler that determines how to handle the response body- Returns:
- a CompletableFuture containing the HTTP response
-
sendNative
@Deprecated(forRemoval=true) <T> HttpResponse<T> sendNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) throws IOException, InterruptedException Deprecated, for removal: This API element is subject to removal in a future version.use JdkHttpClient#httpClient() instead.Sends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.- Type Parameters:
T- the response body type- Parameters:
request- the HTTP request to sendhandler- the BodyHandler that determines how to handle the response body- Returns:
- the HTTP response
- Throws:
IOException- if an I/O error occursInterruptedException- if the operation is interrupted
-