Skip to content

Commit

Permalink
Release 3.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw committed Jan 29, 2021
1 parent cc1c64d commit 76fa4bc
Show file tree
Hide file tree
Showing 25 changed files with 128 additions and 93 deletions.
6 changes: 3 additions & 3 deletions README.md
Expand Up @@ -45,14 +45,14 @@ sttp (v2) documentation is available at [sttp.softwaremill.com/en/v2](http://stt

sttp (v1) documentation is available at [sttp.softwaremill.com/en/v1](https://sttp.softwaremill.com/en/v1).

scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.0.0)
scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.1.0)

## Quickstart with Ammonite

If you are an [Ammonite](http://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following:

```scala
import $ivy.`com.softwaremill.sttp.client3::core:3.0.0`
import $ivy.`com.softwaremill.sttp.client3::core:3.1.0`
import sttp.client3.quick._
quickRequest.get(uri"http://httpbin.org/ip").send(backend)
```
Expand All @@ -64,7 +64,7 @@ This brings in the sttp API and a synchronous backend instance.
Add the following dependency:

```scala
"com.softwaremill.sttp.client3" %% "core" % "3.0.0"
"com.softwaremill.sttp.client3" %% "core" % "3.1.0"
```

Then, import:
Expand Down
4 changes: 2 additions & 2 deletions generated-docs/out/backends/akka.md
Expand Up @@ -3,15 +3,15 @@
This backend is based on [akka-http](http://doc.akka.io/docs/akka-http/current/scala/http/). To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.1.0"
```

A fully **asynchronous** backend. Uses the `Future` effect to return responses. There are also [other `Future`-based backends](future.md), which don't depend on Akka.

Note that you'll also need an explicit dependency on akka-streams, as akka-http doesn't depend on any specific akka-streams version. So you'll also need to add, for example:

```
"com.typesafe.akka" %% "akka-stream" % "2.6.10"
"com.typesafe.akka" %% "akka-stream" % "2.6.11"
```

Next you'll need to add create the backend instance:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/catseffect.md
Expand Up @@ -5,7 +5,7 @@ The [Cats Effect](https://github.com/typelevel/cats-effect) backend is **asynchr
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.0.0"
"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.1.0"
```

You'll need the following imports and implicits to create the backend:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/finagle.md
Expand Up @@ -3,7 +3,7 @@
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.1.0"
```

Next you'll need to add an implicit value:
Expand Down
4 changes: 2 additions & 2 deletions generated-docs/out/backends/fs2.md
Expand Up @@ -7,7 +7,7 @@ The [fs2](https://github.com/functional-streams-for-scala/fs2) backend is **asyn
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.0.0"
"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.1.0"
```

And some imports:
Expand Down Expand Up @@ -76,7 +76,7 @@ val backend = AsyncHttpClientFs2Backend.usingClient[IO](asyncHttpClient, blocker
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "3.0.0"
"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "3.1.0"
```

And some imports:
Expand Down
6 changes: 3 additions & 3 deletions generated-docs/out/backends/future.md
Expand Up @@ -20,7 +20,7 @@ Class Supported stream type
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.0.0"
"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.1.0"
```

And some imports:
Expand Down Expand Up @@ -71,7 +71,7 @@ val backend = AsyncHttpClientFutureBackend.usingClient(asyncHttpClient)
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.1.0"
```

and some imports:
Expand Down Expand Up @@ -103,7 +103,7 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.1.0"
```

and some imports:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/http4s.md
Expand Up @@ -3,7 +3,7 @@
This backend is based on [http4s](https://http4s.org) (client) and is **asynchronous**. To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.1.0"
```

Add some imports as well:
Expand Down
37 changes: 34 additions & 3 deletions generated-docs/out/backends/javascript/fetch.md
@@ -1,11 +1,13 @@
# JavaScript (Fetch) backend

A JavaScript backend implemented using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) and backed via `Future`.
A JavaScript backend implemented using the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API).

## `Future`-based

This is the default backend, available in the main jar for JS. To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %%% "core" % "3.0.0"
"com.softwaremill.sttp.client3" %%% "core" % "3.1.0"
```

And create the backend instance:
Expand All @@ -20,6 +22,35 @@ As browsers do not allow access to redirect responses, if a request sets `follow

Note that `Fetch` does not pass cookies by default. If your request needs cookies then you will need to pass a `FetchOptions` instance with `credentials` set to either `RequestCredentials.same-origin` or `RequestCredentials.include` depending on your requirements.

## Monix-based

To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %%% "monix" % "3.1.0"
```

And create the backend instance:

```scala
val backend = FetchMonixBackend()
```

## cats-effect-based

Any effect implementing the cats-effect `Concurrent` typeclass can be used. To use, add the following dependency to
your project:

```
"com.softwaremill.sttp.client3" %%% "cats" % "3.1.0"
```

And create the backend instance:

```scala
val backend = FetchCatsBackend[IO]()
```

## Node.js

Running sttp in a node.js will require downloading modules that implement the various classes and functions used by sttp, usually available in browser. At minima, you will need replacement for `fetch`, `AbortController` and `Headers`. To achieve this, you can either use `npm` directly, or the `scalajs-bundler` sbt plugin if you use sbt :
Expand Down Expand Up @@ -48,7 +79,7 @@ Streaming support is provided via `FetchMonixBackend`. Note that streaming suppo
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %%% "monix" % "3.0.0"
"com.softwaremill.sttp.client3" %%% "monix" % "3.1.0"
```

An example of streaming a response:
Expand Down
6 changes: 3 additions & 3 deletions generated-docs/out/backends/monix.md
Expand Up @@ -7,7 +7,7 @@ There are several backend implementations which are `monix.eval.Task`-based. The
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.0.0"
"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.1.0"
```
This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes.
Expand Down Expand Up @@ -50,7 +50,7 @@ val backend = AsyncHttpClientMonixBackend.usingClient(asyncHttpClient)
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.0.0"
"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.1.0"
```

Create the backend using:
Expand All @@ -76,7 +76,7 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "httpclient-backend-monix" % "3.0.0"
"com.softwaremill.sttp.client3" %% "httpclient-backend-monix" % "3.1.0"
```

Create the backend using:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/native/curl.md
Expand Up @@ -5,7 +5,7 @@ A Scala Native backend implemented using [Curl](https://github.com/curl/curl/blo
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %%% "core" % "3.0.0"
"com.softwaremill.sttp.client3" %%% "core" % "3.1.0"
```

and initialize one of the backends:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/scalaz.md
Expand Up @@ -5,7 +5,7 @@ The [Scalaz](https://github.com/scalaz/scalaz) backend is **asynchronous**. Send
To use, add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "3.0.0"
"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "3.1.0"
```
This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes.
Expand Down
59 changes: 30 additions & 29 deletions generated-docs/out/backends/summary.md
Expand Up @@ -19,29 +19,29 @@ Each backend has two type parameters:
Below is a summary of all the JVM backends; see the sections on individual backend implementations for more information:

```eval_rst
==================================== ============================ ================================================= ========================== ===================
Class Effect type Supported stream type Supports websockets Fully non-blocking
==================================== ============================ ================================================= ========================== ===================
``HttpURLConnectionBackend`` None (``Identity``) n/a no no
``TryHttpURLConnectionBackend`` ``scala.util.Try`` n/a no no
``AkkaHttpBackend`` ``scala.concurrent.Future`` ``akka.stream.scaladsl.Source[ByteString, Any]`` yes (regular & streaming) yes
``AsyncHttpClientFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``AsyncHttpClientScalazBackend`` ``scalaz.concurrent.Task`` n/a yes (regular) no
``AsyncHttpClientZioBackend`` ``zio.Task`` ``zio.stream.Stream[Throwable, Byte]`` yes (regular & streaming) no
``AsyncHttpClientMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) no
``AsyncHttpClientCatsBackend`` ``F[_]: cats.effect.Async`` n/a no no
``AsyncHttpClientFs2Backend`` ``F[_]: cats.effect.Async`` ``fs2.Stream[F, Byte]`` yes (regular & streaming) no
``OkHttpSyncBackend`` None (``Identity``) n/a yes (regular) no
``OkHttpFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``OkHttpMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) no
``Http4sBackend`` ``F[_]: cats.effect.Effect`` ``fs2.Stream[F, Byte]`` no no
``HttpClientSyncBackend`` None (``Identity``) n/a no no
``HttpClientFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``HttpClientMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) yes
``HttpClientFs2Backend`` ``F[_]: cats.effect.Async`` ``fs2.Stream[F, Byte]`` yes (regular & streaming) yes
``HttpClientZioBackend`` ``zio.Task`` ``zio.stream.Stream[Throwable, Byte]`` yes (regular & streaming) yes
``FinagleBackend`` ``com.twitter.util.Future`` n/a no no
==================================== ============================ ================================================= ========================== ===================
==================================== ================================ ================================================= ========================== ===================
Class Effect type Supported stream type Supports websockets Fully non-blocking
==================================== ================================ ================================================= ========================== ===================
``HttpURLConnectionBackend`` None (``Identity``) n/a no no
``TryHttpURLConnectionBackend`` ``scala.util.Try`` n/a no no
``AkkaHttpBackend`` ``scala.concurrent.Future`` ``akka.stream.scaladsl.Source[ByteString, Any]`` yes (regular & streaming) yes
``AsyncHttpClientFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``AsyncHttpClientScalazBackend`` ``scalaz.concurrent.Task`` n/a yes (regular) no
``AsyncHttpClientZioBackend`` ``zio.Task`` ``zio.stream.Stream[Throwable, Byte]`` yes (regular & streaming) no
``AsyncHttpClientMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) no
``AsyncHttpClientCatsBackend`` ``F[_]: cats.effect.Concurrent`` n/a no no
``AsyncHttpClientFs2Backend`` ``F[_]: cats.effect.Concurrent`` ``fs2.Stream[F, Byte]`` yes (regular & streaming) no
``OkHttpSyncBackend`` None (``Identity``) n/a yes (regular) no
``OkHttpFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``OkHttpMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) no
``Http4sBackend`` ``F[_]: cats.effect.Effect`` ``fs2.Stream[F, Byte]`` no no
``HttpClientSyncBackend`` None (``Identity``) n/a no no
``HttpClientFutureBackend`` ``scala.concurrent.Future`` n/a yes (regular) no
``HttpClientMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` yes (regular & streaming) yes
``HttpClientFs2Backend`` ``F[_]: cats.effect.Concurrent`` ``fs2.Stream[F, Byte]`` yes (regular & streaming) yes
``HttpClientZioBackend`` ``zio.Task`` ``zio.stream.Stream[Throwable, Byte]`` yes (regular & streaming) yes
``FinagleBackend`` ``com.twitter.util.Future`` n/a no no
==================================== ================================ ================================================= ========================== ===================
```

The backends work with Scala 2.11, 2.12 and 2.13 (with some exceptions for 2.11). Moreover, `HttpURLConnectionBackend`, `AsyncHttpClientFutureBackend`, `AsyncHttpClientZioBackend`, `HttpClientSyncBackend`, `HttpClientFutureBackend` and `HttpClientZioBackend` are additionally built with Scala 3.
Expand All @@ -61,12 +61,13 @@ There are also backends which wrap other backends to provide additional function
In addition, there are also backends for Scala.JS:

```eval_rst
================================ ============================ ========================================= ===================
Class Effect type Supported stream type Supports websockets
================================ ============================ ========================================= ===================
``FetchBackend`` ``scala.concurrent.Future`` n/a no
``FetchMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` no
================================ ============================ ========================================= ===================
================================ ================================ ========================================= ===================
Class Effect type Supported stream type Supports websockets
================================ ================================ ========================================= ===================
``FetchBackend`` ``scala.concurrent.Future`` n/a no
``FetchMonixBackend`` ``monix.eval.Task`` ``monix.reactive.Observable[ByteBuffer]`` no
``FetchCatsBackend`` ``F[_]: cats.effect.Concurrent`` n/a no
================================ ================================ ========================================= ===================
```

And a backend for scala-native:
Expand Down
4 changes: 2 additions & 2 deletions generated-docs/out/backends/synchronous.md
Expand Up @@ -20,7 +20,7 @@ This backend works with all Scala versions. A Scala 3 build is available as well
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.1.0"
```

Create the backend using:
Expand Down Expand Up @@ -48,7 +48,7 @@ This backend depends on [OkHttp](http://square.github.io/okhttp/) and fully supp
To use, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.1.0"
```

Create the backend using:
Expand Down
2 changes: 1 addition & 1 deletion generated-docs/out/backends/wrappers/custom.md
Expand Up @@ -266,7 +266,7 @@ object RateLimitingSttpBackend {
Implementing a new backend is made easy as the tests are published in the `core` jar file under the `tests` classifier. Simply add the follow dependencies to your `build.sbt`:

```
"com.softwaremill.sttp.client3" %% "core" % "3.0.0" % Test classifier "tests"
"com.softwaremill.sttp.client3" %% "core" % "3.1.0" % Test classifier "tests"
```

Implement your backend and extend the `HttpTest` class:
Expand Down
4 changes: 2 additions & 2 deletions generated-docs/out/backends/wrappers/logging.md
Expand Up @@ -28,7 +28,7 @@ Log levels can be configured when creating the `LoggingBackend`, or specified in
To use the [slf4j](http://www.slf4j.org) logging backend wrapper, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.1.0"
```

There are three backend wrappers available, which log request & response information using a slf4j `Logger`. To see the logs, you'll need to use an slf4j-compatible logger implementation, e.g. [logback](http://logback.qos.ch), or use a binding, e.g. [log4j-slf4j](https://logging.apache.org/log4j/2.0/log4j-slf4j-impl/index.html).
Expand All @@ -50,5 +50,5 @@ To create a customised logging backend, see the section on [custom backends](cus
To use the [scribe](https://github.com/outr/scribe) logging backend wrapper, add the following dependency to your project:

```
"com.softwaremill.sttp.client3" %% "scribe-backend" % "3.0.0"
"com.softwaremill.sttp.client3" %% "scribe-backend" % "3.1.0"
```

0 comments on commit 76fa4bc

Please sign in to comment.