From 80658b04e0be3e0a150386fbb4fe3904e6ee988c Mon Sep 17 00:00:00 2001 From: adamw Date: Tue, 27 Apr 2021 10:44:51 +0200 Subject: [PATCH] Release 3.3.0 --- README.md | 8 ++-- generated-docs/out/backends/akka.md | 2 +- generated-docs/out/backends/catseffect.md | 8 ++-- generated-docs/out/backends/finagle.md | 2 +- generated-docs/out/backends/fs2.md | 12 +++--- generated-docs/out/backends/future.md | 8 ++-- generated-docs/out/backends/http4s.md | 4 +- .../out/backends/javascript/fetch.md | 8 ++-- generated-docs/out/backends/monix.md | 8 ++-- generated-docs/out/backends/native/curl.md | 2 +- generated-docs/out/backends/scalaz.md | 4 +- generated-docs/out/backends/synchronous.md | 4 +- .../out/backends/wrappers/custom.md | 2 +- .../out/backends/wrappers/logging.md | 4 +- .../out/backends/wrappers/opentracing.md | 2 +- .../out/backends/wrappers/prometheus.md | 2 +- .../backends/wrappers/zio-opentelemetry.md | 2 +- .../out/backends/wrappers/zio-opentracing.md | 2 +- generated-docs/out/backends/zio.md | 6 +-- generated-docs/out/examples.md | 42 +++++++++---------- generated-docs/out/index.md | 2 +- generated-docs/out/json.md | 12 +++--- generated-docs/out/openapi.md | 8 ++-- generated-docs/out/quickstart.md | 6 +-- generated-docs/out/testing.md | 12 ++++-- 25 files changed, 88 insertions(+), 84 deletions(-) diff --git a/README.md b/README.md index 3a7254090f..f27826cecb 100755 --- a/README.md +++ b/README.md @@ -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.3.0-RC5) +scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.3.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.3.0-RC5` +import $ivy.`com.softwaremill.sttp.client3::core:3.3.0` import sttp.client3.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "core" % "3.3.0" ``` Then, import: @@ -98,7 +98,7 @@ The documentation is typechecked using [mdoc](https://scalameta.org/mdoc/). The When generating documentation, it's best to set the version to the current one, so that the generated doc files don't include modifications with the current snapshot version. -That is, in sbt run: `set version := "3.3.0-RC5"`, before running `mdoc` in `docs`. +That is, in sbt run: `set version := "3.3.0"`, before running `mdoc` in `docs`. ### Testing the Scala.JS backend diff --git a/generated-docs/out/backends/akka.md b/generated-docs/out/backends/akka.md index d989db25df..b2e5f13a53 100644 --- a/generated-docs/out/backends/akka.md +++ b/generated-docs/out/backends/akka.md @@ -3,7 +3,7 @@ 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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.3.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. diff --git a/generated-docs/out/backends/catseffect.md b/generated-docs/out/backends/catseffect.md index 2f1cbca631..4d7ff2d01d 100644 --- a/generated-docs/out/backends/catseffect.md +++ b/generated-docs/out/backends/catseffect.md @@ -7,9 +7,9 @@ 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.3.0-RC5" // for cats-effect 3.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.3.0" // for cats-effect 3.x // or -"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats-ce2" % "3.3.0-RC5" // for cats-effect 2.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats-ce2" % "3.3.0" // for cats-effect 2.x ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes. @@ -81,9 +81,9 @@ val backend = AsyncHttpClientCatsBackend.usingClient[IO](asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "armeria-backend-cats" % "3.3.0-RC5" // for cats-effect 3.x +"com.softwaremill.sttp.client3" %% "armeria-backend-cats" % "3.3.0" // for cats-effect 3.x // or -"com.softwaremill.sttp.client3" %% "armeria-backend-cats-ce2" % "3.3.0-RC5" // for cats-effect 2.x +"com.softwaremill.sttp.client3" %% "armeria-backend-cats-ce2" % "3.3.0" // for cats-effect 2.x ``` create client: diff --git a/generated-docs/out/backends/finagle.md b/generated-docs/out/backends/finagle.md index 266d92e51e..8827aa3776 100644 --- a/generated-docs/out/backends/finagle.md +++ b/generated-docs/out/backends/finagle.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.3.0" ``` Next you'll need to add an implicit value: diff --git a/generated-docs/out/backends/fs2.md b/generated-docs/out/backends/fs2.md index 5eb61d7d98..c2b994a0d4 100644 --- a/generated-docs/out/backends/fs2.md +++ b/generated-docs/out/backends/fs2.md @@ -7,9 +7,9 @@ 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.3.0-RC5" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.3.0" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2-ce2" % "3.3.0-RC5" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2-ce2" % "3.3.0" // for cats-effect 2.x & fs2 2.x ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -88,9 +88,9 @@ val backend = AsyncHttpClientFs2Backend.usingClient[IO](asyncHttpClient, dispatc To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "3.3.0-RC5" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2" % "3.3.0" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2-ce2" % "3.3.0-RC5" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "httpclient-backend-fs2-ce2" % "3.3.0" // for cats-effect 2.x & fs2 2.x ``` Create the backend using a cats-effect `Resource`: @@ -140,9 +140,9 @@ jdk.httpclient.allowRestrictedHeaders=host To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.3.0-RC5" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.3.0" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.3.0-RC5" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.3.0" // for cats-effect 2.x & fs2 2.x ``` create client: diff --git a/generated-docs/out/backends/future.md b/generated-docs/out/backends/future.md index a15d4e86e1..8f98566d59 100644 --- a/generated-docs/out/backends/future.md +++ b/generated-docs/out/backends/future.md @@ -21,7 +21,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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.3.0" ``` And some imports: @@ -72,7 +72,7 @@ val backend = AsyncHttpClientFutureBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.3.0" ``` and some imports: @@ -104,7 +104,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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.3.0" ``` and some imports: @@ -141,7 +141,7 @@ jdk.httpclient.allowRestrictedHeaders=host To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "armeria-backend-future" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "armeria-backend-future" % "3.3.0" ``` add imports: diff --git a/generated-docs/out/backends/http4s.md b/generated-docs/out/backends/http4s.md index 8f0c4e6e60..40c57353d7 100644 --- a/generated-docs/out/backends/http4s.md +++ b/generated-docs/out/backends/http4s.md @@ -3,9 +3,9 @@ This backend is based on [http4s](https://http4s.org) (client) and is **asynchronous**. To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.3.0-RC5" // for cats-effect 3.x & http4s 1.0.0-Mx +"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.3.0" // for cats-effect 3.x & http4s 1.0.0-Mx // or -"com.softwaremill.sttp.client3" %% "http4s-backend-ce2" % "3.3.0-RC5" // for cats-effect 2.x & http4s 0.21.x +"com.softwaremill.sttp.client3" %% "http4s-backend-ce2" % "3.3.0" // for cats-effect 2.x & http4s 0.21.x ``` The backend can be created in a couple of ways, e.g.: diff --git a/generated-docs/out/backends/javascript/fetch.md b/generated-docs/out/backends/javascript/fetch.md index 0e47d4d1f7..c7e9244a90 100644 --- a/generated-docs/out/backends/javascript/fetch.md +++ b/generated-docs/out/backends/javascript/fetch.md @@ -7,7 +7,7 @@ A JavaScript backend with web socket support. Implemented using the [Fetch API]( 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.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "core" % "3.3.0" ``` And create the backend instance: @@ -26,7 +26,7 @@ Note that `Fetch` does not pass cookies by default. If your request needs cookie To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %%% "monix" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "monix" % "3.3.0" ``` And create the backend instance: @@ -41,7 +41,7 @@ Any effect implementing the cats-effect `Concurrent` typeclass can be used. To u your project: ``` -"com.softwaremill.sttp.client3" %%% "cats" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "cats" % "3.3.0" ``` And create the backend instance: @@ -80,7 +80,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.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "monix" % "3.3.0" ``` An example of streaming a response: diff --git a/generated-docs/out/backends/monix.md b/generated-docs/out/backends/monix.md index 578cc47ff7..ddf1c078a3 100644 --- a/generated-docs/out/backends/monix.md +++ b/generated-docs/out/backends/monix.md @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes. @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.3.0" ``` Create the backend using: @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "httpclient-backend-monix" % "3.3.0" ``` Create the backend using: @@ -107,7 +107,7 @@ jdk.httpclient.allowRestrictedHeaders=host To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "armeria-backend-monix" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "armeria-backend-monix" % "3.3.0" ``` add imports: diff --git a/generated-docs/out/backends/native/curl.md b/generated-docs/out/backends/native/curl.md index cced5c99b3..09b1d3621b 100644 --- a/generated-docs/out/backends/native/curl.md +++ b/generated-docs/out/backends/native/curl.md @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "core" % "3.3.0" ``` and initialize one of the backends: diff --git a/generated-docs/out/backends/scalaz.md b/generated-docs/out/backends/scalaz.md index ea9f6f3749..11842a7ade 100644 --- a/generated-docs/out/backends/scalaz.md +++ b/generated-docs/out/backends/scalaz.md @@ -7,7 +7,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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "3.3.0" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client) and uses [Netty](http://netty.io) behind the scenes. @@ -45,7 +45,7 @@ val backend = AsyncHttpClientScalazBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "armeria-backend-scalaz" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "armeria-backend-scalaz" % "3.3.0" ``` add imports: diff --git a/generated-docs/out/backends/synchronous.md b/generated-docs/out/backends/synchronous.md index 9ab9f1cf62..44b0cecef5 100644 --- a/generated-docs/out/backends/synchronous.md +++ b/generated-docs/out/backends/synchronous.md @@ -25,7 +25,7 @@ sun.net.http.allowRestrictedHeaders=true To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.3.0" ``` Create the backend using: @@ -53,7 +53,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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "httpclient-backend" % "3.3.0" ``` Create the backend using: diff --git a/generated-docs/out/backends/wrappers/custom.md b/generated-docs/out/backends/wrappers/custom.md index 006deb4702..8bbe730668 100644 --- a/generated-docs/out/backends/wrappers/custom.md +++ b/generated-docs/out/backends/wrappers/custom.md @@ -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.3.0-RC5" % Test classifier "tests" +"com.softwaremill.sttp.client3" %% "core" % "3.3.0" % Test classifier "tests" ``` Implement your backend and extend the `HttpTest` class: diff --git a/generated-docs/out/backends/wrappers/logging.md b/generated-docs/out/backends/wrappers/logging.md index 82a407bb7d..40e06dc85c 100644 --- a/generated-docs/out/backends/wrappers/logging.md +++ b/generated-docs/out/backends/wrappers/logging.md @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.3.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). @@ -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.3.0-RC5" +"com.softwaremill.sttp.client3" %% "scribe-backend" % "3.3.0" ``` \ No newline at end of file diff --git a/generated-docs/out/backends/wrappers/opentracing.md b/generated-docs/out/backends/wrappers/opentracing.md index 82c1bf316d..dc08f4fd89 100644 --- a/generated-docs/out/backends/wrappers/opentracing.md +++ b/generated-docs/out/backends/wrappers/opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "opentracing-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "opentracing-backend" % "3.3.0" ``` This backend depends on [opentracing](https://github.com/opentracing/opentracing-java), a standardized set of api for distributed tracing. diff --git a/generated-docs/out/backends/wrappers/prometheus.md b/generated-docs/out/backends/wrappers/prometheus.md index 79d23d2354..a043394869 100644 --- a/generated-docs/out/backends/wrappers/prometheus.md +++ b/generated-docs/out/backends/wrappers/prometheus.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "prometheus-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "prometheus-backend" % "3.3.0" ``` and some imports: diff --git a/generated-docs/out/backends/wrappers/zio-opentelemetry.md b/generated-docs/out/backends/wrappers/zio-opentelemetry.md index 3df2d49822..39fc98bd58 100644 --- a/generated-docs/out/backends/wrappers/zio-opentelemetry.md +++ b/generated-docs/out/backends/wrappers/zio-opentelemetry.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "zio-telemetry-opentelemetry-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "zio-telemetry-opentelemetry-backend" % "3.3.0" ``` This backend depends on [zio-opentelemetry](https://github.com/zio/zio-telemetry). diff --git a/generated-docs/out/backends/wrappers/zio-opentracing.md b/generated-docs/out/backends/wrappers/zio-opentracing.md index fcf8b3c58b..d68218e46a 100644 --- a/generated-docs/out/backends/wrappers/zio-opentracing.md +++ b/generated-docs/out/backends/wrappers/zio-opentracing.md @@ -3,7 +3,7 @@ To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "zio-telemetry-opentracing-backend" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "zio-telemetry-opentracing-backend" % "3.3.0" ``` This backend depends on [zio-opentracing](https://github.com/zio/zio-telemetry). diff --git a/generated-docs/out/backends/zio.md b/generated-docs/out/backends/zio.md index a8dc999f66..b79ca03618 100644 --- a/generated-docs/out/backends/zio.md +++ b/generated-docs/out/backends/zio.md @@ -7,7 +7,7 @@ The [ZIO](https://github.com/zio/zio) backends are **asynchronous**. Sending a r To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "httpclient-backend-zio" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "httpclient-backend-zio" % "3.3.0" ``` Create the backend using: @@ -38,7 +38,7 @@ jdk.httpclient.allowRestrictedHeaders=host To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes. This backend works with all Scala versions. A Scala 3 build is available as well. @@ -84,7 +84,7 @@ val backend = AsyncHttpClientZioBackend.usingClient(runtime, asyncHttpClient) To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "armeria-backend-zio" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "armeria-backend-zio" % "3.3.0" ``` add imports: diff --git a/generated-docs/out/examples.md b/generated-docs/out/examples.md index d663aee30f..0fca3edeee 100644 --- a/generated-docs/out/examples.md +++ b/generated-docs/out/examples.md @@ -7,7 +7,7 @@ All of the examples are available [in the sources](https://github.com/softwaremi Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0") ``` Example code: @@ -23,8 +23,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.3.0", + "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0", "org.json4s" %% "json4s-native" % "3.6.0" ) ``` @@ -42,8 +42,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "circe" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0", + "com.softwaremill.sttp.client3" %% "circe" % "3.3.0", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -61,8 +61,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "circe" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0", + "com.softwaremill.sttp.client3" %% "circe" % "3.3.0", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -80,8 +80,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "circe" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.3.0", + "com.softwaremill.sttp.client3" %% "circe" % "3.3.0", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -99,8 +99,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "circe" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0", + "com.softwaremill.sttp.client3" %% "circe" % "3.3.0", "io.circe" %% "circe-generic" % "0.13.0" ) ``` @@ -117,7 +117,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0") ``` Example code: @@ -132,7 +132,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0") ``` Example code: @@ -147,7 +147,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2 % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2 % "3.3.0") ``` Example code: @@ -162,7 +162,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0") ``` Example code: @@ -177,7 +177,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.3.0") ``` Example code: @@ -192,7 +192,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.3.0") ``` Example code: @@ -207,7 +207,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.3.0") ``` Example code: @@ -222,7 +222,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0") ``` Example code: @@ -237,7 +237,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.3.0") ``` Example code: @@ -252,7 +252,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.3.0") ``` Example code: diff --git a/generated-docs/out/index.md b/generated-docs/out/index.md index 9bee797885..73319eab59 100644 --- a/generated-docs/out/index.md +++ b/generated-docs/out/index.md @@ -5,7 +5,7 @@ Welcome! [sttp client](https://github.com/softwaremill/sttp) is an open-source library which provides a clean, programmer-friendly API to describe HTTP requests and how to handle responses. Requests are sent using one of the backends, which wrap other Scala or Java HTTP client implementations. The backends can integrate with a variety of Scala stacks, providing both synchronous and asynchronous, procedural and functional interfaces. -Backend implementations include ones based on [akka-http](https://doc.akka.io/docs/akka-http/current/scala/http/), [async-http-client](https://github.com/AsyncHttpClient/async-http-client), [http4s](https://http4s.org), [OkHttp](http://square.github.io/okhttp/), and HTTP clients which ship with Java. They integrate with [Akka](https://akka.io), [Monix](https://monix.io), [fs2](https://github.com/functional-streams-for-scala/fs2), [cats-effect](https://github.com/typelevel/cats-effect), [scalaz](https://github.com/scalaz/scalaz) and [ZIO](https://github.com/zio/zio). Supported Scala versions include 2.11, 2.12, 2.13 and 3. +Backend implementations include ones based on [akka-http](https://doc.akka.io/docs/akka-http/current/scala/http/), [async-http-client](https://github.com/AsyncHttpClient/async-http-client), [http4s](https://http4s.org), [OkHttp](http://square.github.io/okhttp/), and HTTP clients which ship with Java. They integrate with [Akka](https://akka.io), [Monix](https://monix.io), [fs2](https://github.com/functional-streams-for-scala/fs2), [cats-effect](https://github.com/typelevel/cats-effect), [scalaz](https://github.com/scalaz/scalaz) and [ZIO](https://github.com/zio/zio). Supported Scala versions include 2.11, 2.12, 2.13 and 3, Scala.JS and Scala Native. Here's a quick example of sttp client in action: diff --git a/generated-docs/out/json.md b/generated-docs/out/json.md index 4feab23a72..9749474437 100644 --- a/generated-docs/out/json.md +++ b/generated-docs/out/json.md @@ -34,7 +34,7 @@ case class ResponsePayload(data: String) JSON encoding of bodies and decoding of responses can be handled using [Circe](https://circe.github.io/circe/) by the `circe` module. To use add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "circe" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "circe" % "3.3.0" ``` This module adds a body serialized, so that json payloads can be sent as request bodies. To send a payload of type `T` as json, a `io.circe.Encoder[T]` implicit value must be available in scope. @@ -66,7 +66,7 @@ Arbitrary JSON structures can be traversed by parsing the result as `io.circe.Js To encode and decode json using json4s, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "json4s" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "json4s" % "3.3.0" "org.json4s" %% "json4s-native" % "3.6.0" ``` @@ -100,7 +100,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [spray-json](https://github.com/spray/spray-json), add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "spray-json" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "spray-json" % "3.3.0" ``` Using this module it is possible to set request bodies and read response bodies as your custom types, using the implicitly available instances of `spray.json.JsonWriter` / `spray.json.JsonReader` or `spray.json.JsonFormat`. @@ -132,7 +132,7 @@ val response: Identity[Response[Either[ResponseException[String, Exception], Res To encode and decode JSON using [play-json](https://www.playframework.com), add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "play-json" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "play-json" % "3.3.0" ``` To use, add an import: `import sttp.client3.playJson._`. @@ -142,11 +142,11 @@ To use, add an import: `import sttp.client3.playJson._`. To encode and decode JSON using the high-performance [zio-json](https://zio.github.io/zio-json/) library, one add the following dependency to your project. ```scala -"com.softwaremill.sttp.client3" %% "zio-json" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "zio-json" % "3.3.0" ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client3" %%% "zio-json" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %%% "zio-json" % "3.3.0" ``` To use, add an import: `import sttp.client3.ziojson._` (or extend `SttpZioJsonApi`), define an implicit `JsonCodec`, or `JsonDecoder`/`JsonEncoder` for your datatype. diff --git a/generated-docs/out/openapi.md b/generated-docs/out/openapi.md index 0e7ab34a6a..16f65ca4a7 100644 --- a/generated-docs/out/openapi.md +++ b/generated-docs/out/openapi.md @@ -36,8 +36,8 @@ lazy val petstoreApi: Project = project openApiGeneratorName := "scala-sttp", openApiOutputDir := baseDirectory.value.name, libraryDependencies ++= Seq( - "com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "core" % "3.3.0", + "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0", "org.json4s" %% "json4s-jackson" % "3.6.8" ) ) @@ -87,8 +87,8 @@ lazy val petstoreApi: Project = project openApiOutputDir := baseDirectory.value.name, openApiIgnoreFileOverride := s"${baseDirectory.in(ThisBuild).value.getPath}/openapi-ignore-file", libraryDependencies ++= Seq( - "com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5", - "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0-RC5", + "com.softwaremill.sttp.client3" %% "core" % "3.3.0", + "com.softwaremill.sttp.client3" %% "json4s" % "3.3.0", "org.json4s" %% "json4s-jackson" % "3.6.8" ), (compile in Compile) := ((compile in Compile) dependsOn openApiGenerate).value, diff --git a/generated-docs/out/quickstart.md b/generated-docs/out/quickstart.md index 6b6016bc3b..9585d6ec26 100644 --- a/generated-docs/out/quickstart.md +++ b/generated-docs/out/quickstart.md @@ -9,7 +9,7 @@ To integrate with other parts of your application, you'll often need to use an a The basic dependency which provides the API and the default synchronous backend is: ```scala -"com.softwaremill.sttp.client3" %% "core" % "3.3.0-RC5" +"com.softwaremill.sttp.client3" %% "core" % "3.3.0" ``` `sttp client` is available for Scala 2.11, 2.12 and 2.13, and requires Java 8, as well as for Scala 3. @@ -21,7 +21,7 @@ The basic dependency which provides the API and the default synchronous backend If you are an [Ammonite](https://ammonite.io) user, you can quickly start experimenting with sttp by copy-pasting the following: ```scala -import $ivy.`com.softwaremill.sttp.client3::core:3.3.0-RC5` +import $ivy.`com.softwaremill.sttp.client3::core:3.3.0` import sttp.client3.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` @@ -31,7 +31,7 @@ Importing the `quick` object has the same effect as importing `sttp.client3._`, If the default `HttpURLConnectionBackend` for some reason is insufficient, you can also use one based on OkHttp or HttpClient: ```scala -import $ivy.`com.softwaremill.sttp.client3::okhttp-backend:3.3.0-RC5` +import $ivy.`com.softwaremill.sttp.client3::okhttp-backend:3.3.0` import sttp.client3.okhttp.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ``` diff --git a/generated-docs/out/testing.md b/generated-docs/out/testing.md index 2d8849d3fa..dd6042ac1b 100644 --- a/generated-docs/out/testing.md +++ b/generated-docs/out/testing.md @@ -63,7 +63,11 @@ val response1 = basicRequest.get(uri"http://example.org/partial10").send(testing val response2 = basicRequest.post(uri"http://example.org/partialAda").send(testingBackend) ``` -This approach to testing has one caveat: the responses are not type-safe. That is, the stub backend cannot match on or verify that the type of the response body matches the response body type requested. +```eval_rst +.. note:: + + This approach to testing has one caveat: the responses are not type-safe. That is, the stub backend cannot match on or verify that the type of the response body matches the response body type, as it was requested. However, when a "raw" response is provided (a ``String``, ``Array[Byte]``, ``InputStream``, or a non-blocking stream wrapped in ``RawStream``), it will be handled as specified by the response specification - see below for details. +``` Another way to specify the behaviour is passing response wrapped in the effect to the stub. It is useful if you need to test a scenario with a slow server, when the response should be not returned immediately, but after some time. Example with Futures: @@ -141,7 +145,7 @@ val testingBackend = SttpBackendStub.synchronous ## Adjusting the response body type -If the type of the response body returned by the stub's rules (as specified using the `.whenXxx` methods) doesn't match what was specified in the request, the stub will attempt to convert the body to the desired type. This might be useful when: +The stub will attempt to convert the body returned by the stub (as specified using the `.whenXxx` methods) to the desired type. If the given body isn't in one of the supported "raw" types, no conversions are done and the value is returned as-is. This might be useful when: * testing code which maps a basic response body to a custom type, e.g. mapping a raw json string using a decoder to a domain type * reading a classpath resource (which results in an `InputStream`) and requesting a response of e.g. type `String` @@ -177,14 +181,14 @@ In the example above, the stub's rules specify that a response with a `String`-b ## Example: returning a file -If you want to return a file and have a response handler set up like this: +If you want to save the response to a file and have the response handler set up like this: ```scala val destination = new File("path/to/file.ext") basicRequest.get(uri"http://example.com").response(asFile(destination)) ``` -Then set up the stub like this: +With the stub created as follows: ```scala val fileResponseHandle = new File("path/to/file.ext")