A {@link Connector} that utilizes the Apache HTTP Client to send and receiveHTTP request and responses.
The following properties are only supported at construction of this class:
- {@link ApacheClientProperties#CONNECTION_MANAGER}
- {@link ApacheClientProperties#HTTP_PARAMS}
- {@link ApacheClientProperties#CREDENTIALS_PROVIDER}
- {@link ApacheClientProperties#DISABLE_COOKIES}
- {@link ApacheClientProperties#PROXY_URI}
- {@link ApacheClientProperties#PROXY_USERNAME}
- {@link ApacheClientProperties#PROXY_PASSWORD}
- {@link ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION}
By default a request entity is buffered and repeatable such that authorization may be performed automatically in response to a 401 response.
If the property {@link org.glassfish.jersey.client.ClientProperties#CHUNKED_ENCODING_SIZE} sizeis set to a value greater than 0 then chunked encoding will be enabled and the request entity (if present) will not be buffered and is not repeatable. For authorization to work in such scenarios the property {@link org.glassfish.jersey.apache.connector.ApacheClientProperties#PREEMPTIVE_BASIC_AUTHENTICATION} mustbe set to {@code true}.
If a {@link org.glassfish.jersey.client.ClientResponse} is obtained and anentity is not read from the response then {@link org.glassfish.jersey.client.ClientResponse#close()} MUST be calledafter processing the response to release connection-based resources.
Client operations are thread safe, the HTTP connection may be shared between different threads.
If a response entity is obtained that is an instance of {@link Closeable}then the instance MUST be closed after processing the entity to release connection-based resources.
The following methods are currently supported: HEAD, GET, POST, PUT, DELETE and OPTIONS.
@author jorgeluisw@mac.com
@author Paul Sandoz (paul.sandoz at oracle.com)
@author Pavel Bucek (pavel.bucek at oracle.com)
@author Arul Dhesiaseelan (aruld at acm.org)
@see ApacheClientProperties#CONNECTION_MANAGER