aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authoradamw <adam@warski.org>2017-07-21 13:08:18 +0200
committeradamw <adam@warski.org>2017-07-21 13:08:18 +0200
commit2d099f6832f6e362b9a4cd48e81a16c8d77adeaf (patch)
treeb420ba3ad1917dc8cb30d02ba3bbd0b9eb38f8e6 /README.md
parentfaca3ee694f979ae16c727cb1efe077e8c9ac67b (diff)
downloadsttp-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.md29
1 files changed, 28 insertions, 1 deletions
diff --git a/README.md b/README.md
index 1647afe..811da8b 100644
--- a/README.md
+++ b/README.md
@@ -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).