Class JdkHttpClient
java.lang.Object
org.openqa.selenium.remote.http.jdk.JdkHttpClient
- All Implemented Interfaces:
Closeable, AutoCloseable, HttpClient, HttpHandler
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionclient()Will expose the underlying native HttpClient used.voidclose()execute(HttpRequest req) executeAsync(HttpRequest request) static StringmaskUrlCredentials(String uri) static StringopenSocket(HttpRequest request, WebSocket.Listener listener) <T> CompletableFuture<HttpResponse<T>> sendAsyncNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Sends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.<T> HttpResponse<T> sendNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Sends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface HttpHandler
with
-
Field Details
-
LOG
-
-
Method Details
-
client
Will expose the underlying native HttpClient used. -
openSocket
- Specified by:
openSocketin interfaceHttpClient
-
executeAsync
- Specified by:
executeAsyncin interfaceHttpClient
-
execute
- Specified by:
executein interfaceHttpHandler- Throws:
UncheckedIOException
-
maskUrlCredentials
-
maskUrlCredentials
-
sendAsyncNative
public <T> CompletableFuture<HttpResponse<T>> sendAsyncNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) Description copied from interface:HttpClientSends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.- Specified by:
sendAsyncNativein interfaceHttpClient- 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
public <T> HttpResponse<T> sendNative(HttpRequest request, HttpResponse.BodyHandler<T> handler) throws IOException, InterruptedException Description copied from interface:HttpClientSends an HTTP request using java.net.http.HttpClient and allows specifying the BodyHandler.- Specified by:
sendNativein interfaceHttpClient- 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
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceHttpClient
-