public class JdkHttpClient extends Object implements HttpClient
HttpURLConnection based implementation of HttpClient.HttpClient.BodySuppliers| Constructor and Description |
|---|
JdkHttpClient()
Creates
JdkHttpClient with no timeouts and proxy. |
JdkHttpClient(Duration connectTimeout,
Duration readTimeout)
Creates
JdkHttpClient with provided timeouts and no proxy. |
JdkHttpClient(Duration connectTimeout,
Duration readTimeout,
Proxy proxy)
Creates
JdkHttpClient with provided timeouts and proxy. |
JdkHttpClient(Proxy proxy)
Creates
JdkHttpClient with no timeouts and provided proxy. |
| Modifier and Type | Method and Description |
|---|---|
HttpResponse |
send(HttpRequest httpRequest,
IOSupplier<? extends InputStream> bodySupplier)
Sends HTTP request with a provided body.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitsendpublic JdkHttpClient()
JdkHttpClient with no timeouts and proxy.public JdkHttpClient(Proxy proxy)
JdkHttpClient with no timeouts and provided proxy.proxy - proxy to usepublic JdkHttpClient(Duration connectTimeout, Duration readTimeout)
JdkHttpClient with provided timeouts and no proxy.connectTimeout - connection timeoutreadTimeout - read timeoutpublic JdkHttpClient(Duration connectTimeout, Duration readTimeout, Proxy proxy)
JdkHttpClient with provided timeouts and proxy.connectTimeout - connection timeoutreadTimeout - read timeoutproxy - proxy to usepublic final HttpResponse send(HttpRequest httpRequest, IOSupplier<? extends InputStream> bodySupplier) throws IOException
HttpClientsend in interface HttpClienthttpRequest - the request to be sentbodySupplier - HTTP body to be sentIOException - an I/O error occursHttpClient.BodySuppliersCopyright © 2023. All rights reserved.