Scalaz backend

The Scalaz backend is asynchronous. Sending a request is a non-blocking, lazily-evaluated operation and results in a response wrapped in a scalaz.concurrent.Task. There’s a transitive dependency on scalaz-concurrent.

To use, add the following dependency to your project:

"com.softwaremill.sttp.client" %% "async-http-client-backend-scalaz" % "2.0.0-RC10"

This backend depends on async-http-client and uses Netty behind the scenes.

Next you’ll need to add an implicit value:

import sttp.client.asynchttpclient.scalaz.AsyncHttpClientScalazBackend

AsyncHttpClientScalazBackend().flatMap { implicit backend => ... }

// or, if you'd like to use custom configuration:
AsyncHttpClientScalazBackend.usingConfig(asyncHttpClientConfig).flatMap { implicit backend => ... }

// or, if you'd like to use adjust the configuration sttp creates:
AsyncHttpClientScalazBackend.usingConfigBuilder(adjustFunction, sttpOptions).flatMap { implicit backend => ... }

// or, if you'd like to instantiate the AsyncHttpClient yourself:
implicit val sttpBackend = AsyncHttpClientScalazBackend.usingClient(asyncHttpClient)

Streaming

This backend doesn’t support non-blocking streaming.

Websockets

The backend supports websockets by wrapping a low-level Java interface, sttp.client.asynchttpclient.WebSocketHandler.