diff options
author | adamw <adam@warski.org> | 2017-07-21 13:08:18 +0200 |
---|---|---|
committer | adamw <adam@warski.org> | 2017-07-21 13:08:18 +0200 |
commit | 2d099f6832f6e362b9a4cd48e81a16c8d77adeaf (patch) | |
tree | b420ba3ad1917dc8cb30d02ba3bbd0b9eb38f8e6 /README.md | |
parent | faca3ee694f979ae16c727cb1efe077e8c9ac67b (diff) | |
download | sttp-2d099f6832f6e362b9a4cd48e81a16c8d77adeaf.tar.gz sttp-2d099f6832f6e362b9a4cd48e81a16c8d77adeaf.tar.bz2 sttp-2d099f6832f6e362b9a4cd48e81a16c8d77adeaf.zip |
Initial support for async-http-client
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -188,7 +188,7 @@ This handler depends on [akka-http](http://doc.akka.io/docs/akka-http/current/sc A fully **asynchronous** handler. Sending a request returns a response wrapped in a `Future`. -To use, add an implicit value: +Next you'll need to add an implicit value: ```scala implicit val sttpHandler = new AkkaHttpSttpHandler() @@ -235,6 +235,33 @@ val response: Future[Response[Source[ByteString, Any]]] = .send() ``` +### `AsyncHttpClientHandler` + +To use, add the following dependency to your project: + +```scala +"com.softwaremill.sttp" %% "async-http-client-handler" % version +``` + +This handler depends on [async-http-handler](https://github.com/AsyncHttpClient/async-http-client). +A fully **asynchronous** handler, which uses [Netty](http://netty.io) behind the +scenes. Sending a request returns a response wrapped in a `Future`. Different +wrappers will be added in the future. + +Next you'll need to add an implicit value: + +```scala +implicit val sttpHandler = new AsyncHttpClientHandler() + +// or, if you'd like to use custom configuration: +implicit val sttpHandler = new AsyncHttpClientHandler(asyncHttpClientConfig) + +// or, if you'd like to instantiate the AsyncHttpClient yourself: +implicit val sttpHandler = new AsyncHttpClientHandler(asyncHttpClient) +``` + +Streaming is not (yet) supported. + ## Request type All request descriptions have type `RequestT[U, T, S]` (T as in Template). |