Interface HttpURLConnectionFactory
public interface HttpURLConnectionFactory
Class overview
This interface provides a way for client to construct their own
HttpURLConnection, allowing the use of alternate libraries based on
HttpURLConnection (for example OkHttp).
Usage
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.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionopenConnection(URL url) Opens a HTTP connection to the specified URL.voidSets the HTTP proxy that will be used by connections created by this factory.
-
Field Details
-
PROP_HTTP_URL_CONNECTION_FACTORY
- See Also:
-
-
Method Details
-
setProxy
Sets the HTTP proxy that will be used by connections created by this factory.- Parameters:
proxy- theProxythrough which connections will be made. If direct connection is desired,Proxy.NO_PROXYshould be specified.
-
openConnection
Opens a HTTP connection to the specified URL.- Parameters:
url- theURLto connect to- Returns:
- a
HttpURLConnectionto theURL. - Throws:
IOException- See Also:
-