public static interface HttpUrlConnectorProvider.ConnectionFactory
HttpURLConnection
instances.
A factory may be used to create a HttpURLConnection
and configure
it in a custom manner that is not possible using the Client API.
A custom factory instance may be registered in the HttpUrlConnectorProvider
instance
via HttpUrlConnectorProvider.connectionFactory(ConnectionFactory)
method.
Modifier and Type | Method and Description |
---|---|
HttpURLConnection |
getConnection(URL url)
Get a
HttpURLConnection for a given URL. |
default HttpURLConnection |
getConnection(URL url,
Proxy proxy)
Get a
HttpURLConnection for a given URL. |
HttpURLConnection getConnection(URL url) throws IOException
HttpURLConnection
for a given URL.
Implementation of the method MUST be thread-safe and MUST ensure that
a dedicated HttpURLConnection
instance is returned for concurrent
requests.
url
- the endpoint URL.HttpURLConnection
.IOException
- in case the connection cannot be provided.default HttpURLConnection getConnection(URL url, Proxy proxy) throws IOException
HttpURLConnection
for a given URL.
Implementation of the method MUST be thread-safe and MUST ensure that
a dedicated HttpURLConnection
instance is returned for concurrent
requests.
url
- the endpoint URL.proxy
- the configured proxy or null.HttpURLConnection
.IOException
- in case the connection cannot be provided.Copyright © 2007-2021, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.