public interface HttpURLConnectionFactory
This interface provides a way for client to construct their own
HttpURLConnection
, allowing the use of alternate libraries based on
HttpURLConnection
(for example OkHttp).
Implement this interface and provide the name of the implementing class on
IdcHttpClientConfig
through
IdcClientConfig.setProperty(String, String)
, using
PROP_HTTP_URL_CONNECTION_FACTORY
as the key.
Modifier and Type | Field and Description |
---|---|
static String |
PROP_HTTP_URL_CONNECTION_FACTORY |
Modifier and Type | Method and Description |
---|---|
HttpURLConnection |
openConnection(URL url)
Opens a HTTP connection to the specified URL.
|
void |
setProxy(Proxy proxy)
Sets the HTTP proxy that will be used by connections created by this
factory.
|
static final String PROP_HTTP_URL_CONNECTION_FACTORY
void setProxy(Proxy proxy)
proxy
- the Proxy
through which connections will be made. If
direct connection is desired, Proxy.NO_PROXY
should be
specified.HttpURLConnection openConnection(URL url) throws IOException
url
- the URL
to connect toHttpURLConnection
to the URL
.IOException
URL.openConnection()