Previously, anything that called `JavaClient/createClient` performed the same
coercion on the client options before passing them in as the argument. This
commit refactors `createClient` to do this coercion itself, thereby removing a
bunch of duplication.
Also, remove the `common/Client` schema and replace it with the
`HttpAsyncClient` interface, and remove an unnecessary call to `.start` in the
clojure `create-client`.
* Remove comment about :sslengine as an option, because it no longer seems to
be supported.
* Remove duplicate `.setSslContext`
* Use -> macro to clean up client creation and coersion of options
* Remove outdated TODO on the `common/Client` schema
* Remove unused `SslOptions` schema
* Remove unused imports
These functions were previously used for initializing an ssl context for the
clojure http client. However, with the clojure client initialization now just
wrapping the java code, these are no longer needed.
Previously, there were two completely separate code paths for java and clojure
http client initialization. This meant that there was a lot of duplicated
logic between them for handling a number of client options, such as redirect
strategy, ssl protocols and ciphers, and ssl setup.
This refactors clojure client initialization to use JavaClient/createClient,
thereby removing a lot of this duplication.
This commit removes duplicate functionality from the Clojure implementation and reuses the Java request/response handling impl. It doesn't address client creation so there are still two distinct paths for that.
The main changes are Ring <-> Java request/response conversion and the addition of interface ResponseDeliveryDelegate. The delegate implementations take care of the language-specific aspects of response building and promise delivery. One of the Clojure test namespaces is removed too.
There are a few places where we map request method keywords to
http-client function. The http client then maps them back to keywords
which is redundant. This adds a general request function to the protocol
that accepts a keyword method.
This commit updates us to the latest version of the Apache
HTTPAsyncClient. This is necessary in order to make it
possible to use this library in the same VM as the latest
version of clj-http, because they have some common dependencies.
The commit also cleans up some other dependencies while I was
in there.
- Fixes to ExceptionInsertingPipedInputStream
- Fix to async consumer and removal of decompression code
- Use ResponseContentEncoding to do all decompression including removing previous approach
- Clarify tests and add ConnectionException
Adds a new :as option that uses Apache's AsyncConsumer to return the response as quickly as possible then asynchronously stream the response body using piped input/output streams.
The prismatic/plumbing and prismatic/schema library dependencies are
lagging behind the latest stable version. This will increasingly
cause conflicts in trapperkeeper projects. This patch updates the
dependencies and fixes several functions which were validating against
schemas incompatible with the new versions.
* Update project.clj dependencies
* Use protocol schema instead of the protocol object directly