Package io.yupiik.uship.httpclient.core
Class ExtendedHttpClient
- java.lang.Object
-
- java.net.http.HttpClient
-
- io.yupiik.uship.httpclient.core.ExtendedHttpClient
-
- All Implemented Interfaces:
AutoCloseable
public class ExtendedHttpClient extends HttpClient implements AutoCloseable
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.net.http.HttpClient
HttpClient.Builder, HttpClient.Redirect, HttpClient.Version
-
-
Constructor Summary
Constructors Constructor Description ExtendedHttpClient(ExtendedHttpClient extendedHttpClient)ExtendedHttpClient(ExtendedHttpClientConfiguration clientConfiguration)
-
Method Summary
-
Methods inherited from class java.net.http.HttpClient
newBuilder, newHttpClient
-
-
-
-
Constructor Detail
-
ExtendedHttpClient
public ExtendedHttpClient(ExtendedHttpClientConfiguration clientConfiguration)
-
ExtendedHttpClient
public ExtendedHttpClient(ExtendedHttpClient extendedHttpClient)
-
-
Method Detail
-
onClose
public ExtendedHttpClient onClose(Consumer<ExtendedHttpClient> task)
-
getRequestCount
public long getRequestCount()
-
close
public void close()
- Specified by:
closein interfaceAutoCloseable
-
send
public HttpResponse<String> send(HttpRequest request)
-
getFile
public HttpResponse<Path> getFile(HttpRequest request, Path target)
-
send
public <T> HttpResponse<T> send(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler) throws IOException, InterruptedException
- Specified by:
sendin classHttpClient- Throws:
IOExceptionInterruptedException
-
sendAsync
public <T> CompletableFuture<HttpResponse<T>> sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler)
- Specified by:
sendAsyncin classHttpClient
-
sendAsync
public <T> CompletableFuture<HttpResponse<T>> sendAsync(HttpRequest request, HttpResponse.BodyHandler<T> responseBodyHandler, HttpResponse.PushPromiseHandler<T> pushPromiseHandler)
- Specified by:
sendAsyncin classHttpClient
-
cookieHandler
public Optional<CookieHandler> cookieHandler()
- Specified by:
cookieHandlerin classHttpClient
-
connectTimeout
public Optional<Duration> connectTimeout()
- Specified by:
connectTimeoutin classHttpClient
-
followRedirects
public HttpClient.Redirect followRedirects()
- Specified by:
followRedirectsin classHttpClient
-
proxy
public Optional<ProxySelector> proxy()
- Specified by:
proxyin classHttpClient
-
sslContext
public SSLContext sslContext()
- Specified by:
sslContextin classHttpClient
-
sslParameters
public SSLParameters sslParameters()
- Specified by:
sslParametersin classHttpClient
-
authenticator
public Optional<Authenticator> authenticator()
- Specified by:
authenticatorin classHttpClient
-
version
public HttpClient.Version version()
- Specified by:
versionin classHttpClient
-
executor
public Optional<Executor> executor()
- Specified by:
executorin classHttpClient
-
newWebSocketBuilder
public WebSocket.Builder newWebSocketBuilder()
- Overrides:
newWebSocketBuilderin classHttpClient
-
-