File tree Expand file tree Collapse file tree
src/org/openqa/selenium/remote/http Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212See ` java/TESTING.md `
1313
1414## Code conventions
15+ ### Interfaces
16+ - New methods added to existing interfaces must provide a default implementation, if possible.
17+ - Interfaces must not expose the native classes of their implementations.
1518
1619### Logging
1720``` java
Original file line number Diff line number Diff line change @@ -46,7 +46,9 @@ default void close() {}
4646 * @param request the HTTP request to send
4747 * @param handler the BodyHandler that determines how to handle the response body
4848 * @return a CompletableFuture containing the HTTP response
49+ * @deprecated use JdkHttpClient#httpClient() instead.
4950 */
51+ @ Deprecated (forRemoval = true )
5052 <T > CompletableFuture <java .net .http .HttpResponse <T >> sendAsyncNative (
5153 java .net .http .HttpRequest request , java .net .http .HttpResponse .BodyHandler <T > handler );
5254
@@ -59,7 +61,9 @@ <T> CompletableFuture<java.net.http.HttpResponse<T>> sendAsyncNative(
5961 * @return the HTTP response
6062 * @throws java.io.IOException if an I/O error occurs
6163 * @throws InterruptedException if the operation is interrupted
64+ * @deprecated use JdkHttpClient#httpClient() instead.
6265 */
66+ @ Deprecated (forRemoval = true )
6367 <T > java .net .http .HttpResponse <T > sendNative (
6468 java .net .http .HttpRequest request , java .net .http .HttpResponse .BodyHandler <T > handler )
6569 throws java .io .IOException , InterruptedException ;
Original file line number Diff line number Diff line change @@ -158,6 +158,11 @@ protected PasswordAuthentication getPasswordAuthentication() {
158158 this .client = builder .build ();
159159 }
160160
161+ /** Will expose the underlying native HttpClient used. */
162+ public java .net .http .HttpClient client () {
163+ return client ;
164+ }
165+
161166 @ Override
162167 public WebSocket openSocket (HttpRequest request , WebSocket .Listener listener ) {
163168 URI uri ;
You can’t perform that action at this time.
0 commit comments