public final class URLConnectionClientHandler extends TerminatingClientHandler
HttpURLConnection or
HttpsURLConnection to make HTTP requests and receive HTTP responses.
By default a HttpURLConnection or HttpsURLConnection
instance is obtained using URL.openConnection(). This behaviour
may be overridden by registering an HttpURLConnectionFactory
instance when constructing this class.
For SSL configuration of HTTPS the HTTPSProperties may be used
and an instance added as a property of the Client or
ClientRequest.
HttpURLConnectionFactoryRequestWriter.RequestEntityWriter, RequestWriter.RequestEntityWriterListener| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND
A value of "true" declares that the client will try
to set unsupported HTTP method to HttpURLConnection via reflection.
|
EMPTY_ANNOTATIONS| Constructor and Description |
|---|
URLConnectionClientHandler() |
URLConnectionClientHandler(HttpURLConnectionFactory httpURLConnectionFactory)
Construct a new instance with an HTTP URL connection factory.
|
| Modifier and Type | Method and Description |
|---|---|
ClientResponse |
handle(ClientRequest ro)
ClientRequest handler.
|
getMessageBodyWorkers, getRequestEntityWriter, setMessageBodyWorkers, writeRequestEntitypublic static final java.lang.String PROPERTY_HTTP_URL_CONNECTION_SET_METHOD_WORKAROUND
Boolean.
If the property is absent then the default value is "false".public URLConnectionClientHandler(HttpURLConnectionFactory httpURLConnectionFactory)
httpURLConnectionFactory - the HTTP URL connection factory.public URLConnectionClientHandler()
public ClientResponse handle(ClientRequest ro)
ro - ClientRequestCopyright © 2016 Oracle Corporation. All Rights Reserved.