Add a PersistentSyncHttpClient class, which is a wrapper around
CloseableHttpAsyncClient and allows multiple requests to be made
with a persistent synchronous client.
Separate the Java RequestOptions class into two new classes:
RequestOptions, which contains options related to the request,
and ClientOptions, which contains options related to the client.
Both are now required when calling the request methods in
AsyncHttpClient and SyncHttpClient.
The test code related to the configurable SSL protocols was
written using some ciphers that are available in OpenJDK, but
are not available by default in Oracle JDK. This caused the
tests to fail on Oracle JDKs.
This commit changes the test to use some older ciphers that
are available in the Oracle JDK out of the box.
This commit adds configuration settings for the SSL protocols
and cipher suites, in both the java and clojure clients. It
also adds a list of default protocols which will be used if
the protocols setting is not explicitly set.
This commit encodes a request body string per the content of the
Content-Type header. In the event that no charset is specified in the
Content-Type header, the charset is set to UTF-8. Previously, the
request body string was always encoded to ISO-8859-1 and was not
necessarily in sync with the value of the Content-Type header.
Overwrite parameters set in the URL of a request if query
parameters are specified in the options map. If no parameters are
set in the options map, any query parameters set in the URL will
NOT be overwritten and will be successfully passed as part of the
request.
Add query parameter support to the clojure client. User can now
specify a :query-params option in the options map containing a
map of query parameters.
Add request-with-client functions to the async and sync
namespaces. These now do all the work of the request functions,
so that the request functions cannot directly be passed a client
by the user.
Add a persistent sync client to the persistent-sync namespace.
With this namespace, a user can now create a persistent
sync client for reuse. Also, add persistent sync client test.
* Ports the code over to use the Apache HttpAsyncClient library
instead of http-kit, as we were getting some weird and inconsistent
SSL errors from http-kit, and
* Simplify the API (by eliminating a lot of the supported configuration
options). Some of these options we'll eventually want to add back in,
but for now, getting rid of them makes the API less cluttered and
also gives us the opportunity to do a better job writing tests
for new options when we do add support for them.
For now it only supports constructing a new client on every request.
I intend to add API for creating a client explicitly, and a protocol
for how to interact with the client. This will allow users to
re-use an existing client as they see fit... but this hasn't been
implemented yet.
Prior to this commit, we didn't actually have any tests that
started a real web server and made a real request. This
commit adds tests that do this for the clojure and Java
synchronous clients, using SSL.