From fda4b0a64e89038f579dfd3f8728903a60ba854e Mon Sep 17 00:00:00 2001 From: adamw Date: Thu, 25 Aug 2022 14:15:59 +0200 Subject: [PATCH] Release 3.7.5 --- 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 | 12 +++--- 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 | 6 +-- .../out/backends/wrappers/custom.md | 2 +- .../out/backends/wrappers/logging.md | 4 +- .../out/backends/wrappers/opentelemetry.md | 6 +-- .../out/backends/wrappers/prometheus.md | 2 +- generated-docs/out/backends/zio.md | 12 +++--- generated-docs/out/examples.md | 42 +++++++++---------- generated-docs/out/index.md | 6 +-- generated-docs/out/json.md | 20 ++++----- generated-docs/out/model/uri.md | 39 +++++++++++++++++ generated-docs/out/openapi.md | 8 ++-- generated-docs/out/quickstart.md | 6 +-- 23 files changed, 129 insertions(+), 94 deletions(-) diff --git a/README.md b/README.md index 8a678e7855..0bc4e394d0 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.7.4) +scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client3/core_2.12/3.7.5) ## 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.7.4` +import $ivy.`com.softwaremill.sttp.client3::core:3.7.5` 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.7.4" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" ``` Then, import: @@ -99,7 +99,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.7.4"`, before running `mdoc` in `docs`. +That is, in sbt run: `set version := "3.7.5"`, 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 dee524ae79..5d52d6342c 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.7.4" +"com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.7.5" ``` 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 e650deb8fc..654d78bd1f 100644 --- a/generated-docs/out/backends/catseffect.md +++ b/generated-docs/out/backends/catseffect.md @@ -9,9 +9,9 @@ Note that all [fs2](fs2.md) backends also support any cats-effect effect, additi To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.7.4" // for cats-effect 3.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats" % "3.7.5" // for cats-effect 3.x // or -"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats-ce2" % "3.7.4" // for cats-effect 2.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-cats-ce2" % "3.7.5" // 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. @@ -83,9 +83,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.7.4" // for cats-effect 3.x +"com.softwaremill.sttp.client3" %% "armeria-backend-cats" % "3.7.5" // for cats-effect 3.x // or -"com.softwaremill.sttp.client3" %% "armeria-backend-cats-ce2" % "3.7.4" // for cats-effect 2.x +"com.softwaremill.sttp.client3" %% "armeria-backend-cats-ce2" % "3.7.5" // for cats-effect 2.x ``` create client: diff --git a/generated-docs/out/backends/finagle.md b/generated-docs/out/backends/finagle.md index 486cd63926..39a9d50fd2 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.7.4" +"com.softwaremill.sttp.client3" %% "finagle-backend" % "3.7.5" ``` 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 706b5c44a6..7eb3947f99 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) backends are **as To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "fs2" % "3.7.4" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "fs2" % "3.7.5" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "fs2-ce2" % "3.7.4" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "fs2-ce2" % "3.7.5" // for cats-effect 2.x & fs2 2.x ``` Obtain a cats-effect `Resource` which creates the backend, and closes the thread pool after the resource is no longer used: @@ -60,9 +60,9 @@ Host header override is supported in environments running Java 12 onwards, but i To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.4" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.5" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2-ce2" % "3.7.4" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2-ce2" % "3.7.5" // 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. @@ -141,9 +141,9 @@ val backend = AsyncHttpClientFs2Backend.usingClient[IO](asyncHttpClient, dispatc To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.7.4" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.7.5" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.7.4" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client3" %% "armeria-backend-fs2" % "3.7.5" // 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 79f59de1c2..15b675d599 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, you don't need any extra dependencies, `core` is enough: ``` -"com.softwaremill.sttp.client3" %% "core" % "3.7.4" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" ``` You'll need the following imports: @@ -59,7 +59,7 @@ Host header override is supported in environments running Java 12 onwards, but i To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.7.4" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-future" % "3.7.5" ``` And some imports: @@ -110,7 +110,7 @@ val backend = AsyncHttpClientFutureBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.7.4" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.7.5" ``` and some imports: @@ -142,7 +142,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" %% "armeria-backend" % "3.7.4" +"com.softwaremill.sttp.client3" %% "armeria-backend" % "3.7.5" ``` add imports: diff --git a/generated-docs/out/backends/http4s.md b/generated-docs/out/backends/http4s.md index fa6fce1013..e445066d3c 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.7.4" // for cats-effect 3.x & http4s 1.0.0-Mx +"com.softwaremill.sttp.client3" %% "http4s-backend" % "3.7.5" // for cats-effect 3.x & http4s 1.0.0-Mx // or -"com.softwaremill.sttp.client3" %% "http4s-ce2-backend" % "3.7.4" // for cats-effect 2.x & http4s 0.21.x +"com.softwaremill.sttp.client3" %% "http4s-ce2-backend" % "3.7.5" // 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 4b2ac4b21f..4c598e7c21 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.7.4" +"com.softwaremill.sttp.client3" %%% "core" % "3.7.5" ``` 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.7.4" +"com.softwaremill.sttp.client3" %%% "monix" % "3.7.5" ``` And create the backend instance: @@ -40,7 +40,7 @@ val backend = FetchMonixBackend() To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %%% "zio" % "3.7.4" +"com.softwaremill.sttp.client3" %%% "zio" % "3.7.5" ``` And create the backend instance: @@ -55,13 +55,13 @@ Any effect implementing the cats-effect `Concurrent` typeclass can be used. To u your project: ``` -"com.softwaremill.sttp.client3" %%% "cats" % "3.7.4" +"com.softwaremill.sttp.client3" %%% "cats" % "3.7.5" ``` If you are on Cats Effect 2 (CE2) you will need to add the CE2 specific dependency instead: ``` -"com.softwaremill.sttp.client3" %%% "catsce2 % "3.7.4" +"com.softwaremill.sttp.client3" %%% "catsce2 % "3.7.5" ``` And create the backend instance: @@ -129,7 +129,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.7.4" +"com.softwaremill.sttp.client3" %%% "monix" % "3.7.5" ``` An example of streaming a response: diff --git a/generated-docs/out/backends/monix.md b/generated-docs/out/backends/monix.md index 6683f5f659..cec9480083 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: ``` -"com.softwaremill.sttp.client3" %% "monix" % "3.7.4" +"com.softwaremill.sttp.client3" %% "monix" % "3.7.5" ``` Create the backend using: @@ -39,7 +39,7 @@ Host header override is supported in environments running Java 12 onwards, but i To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.4" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.5" ``` This backend depends on [async-http-client](https://github.com/AsyncHttpClient/async-http-client), uses [Netty](http://netty.io) behind the scenes. @@ -82,7 +82,7 @@ val backend = AsyncHttpClientMonixBackend.usingClient(asyncHttpClient) To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.7.4" +"com.softwaremill.sttp.client3" %% "okhttp-backend-monix" % "3.7.5" ``` Create the backend using: @@ -108,7 +108,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" %% "armeria-backend-monix" % "3.7.4" +"com.softwaremill.sttp.client3" %% "armeria-backend-monix" % "3.7.5" ``` add imports: diff --git a/generated-docs/out/backends/native/curl.md b/generated-docs/out/backends/native/curl.md index b19f008483..ef2ffd97d7 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.7.4" +"com.softwaremill.sttp.client3" %%% "core" % "3.7.5" ``` and initialize one of the backends: diff --git a/generated-docs/out/backends/scalaz.md b/generated-docs/out/backends/scalaz.md index 635d32af72..d98c75ad7f 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.7.4" +"com.softwaremill.sttp.client3" %% "async-http-client-backend-scalaz" % "3.7.5" ``` 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.7.4" +"com.softwaremill.sttp.client3" %% "armeria-backend-scalaz" % "3.7.5" ``` add imports: diff --git a/generated-docs/out/backends/synchronous.md b/generated-docs/out/backends/synchronous.md index 57ddb64327..54b39a035b 100644 --- a/generated-docs/out/backends/synchronous.md +++ b/generated-docs/out/backends/synchronous.md @@ -7,7 +7,7 @@ There are several synchronous backend implementations. Sending a request using t The default **synchronous** backend. To use, you don't need any extra dependencies, `core` is enough: ``` -"com.softwaremill.sttp.client3" %% "core" % "3.7.4" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" ``` Create the backend using: @@ -40,7 +40,7 @@ Host header override is supported in environments running Java 12 onwards, but i To use, you don't need any extra dependencies, `core` is enough: ``` -"com.softwaremill.sttp.client3" %% "core" % "3.7.4" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" ``` Create the backend using: @@ -62,7 +62,7 @@ This backend supports host header override, but it has to be enabled by system p To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.7.4" +"com.softwaremill.sttp.client3" %% "okhttp-backend" % "3.7.5" ``` Create the backend using: diff --git a/generated-docs/out/backends/wrappers/custom.md b/generated-docs/out/backends/wrappers/custom.md index 3fb4c9c7a9..c33add7e62 100644 --- a/generated-docs/out/backends/wrappers/custom.md +++ b/generated-docs/out/backends/wrappers/custom.md @@ -238,7 +238,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.7.4" % Test classifier "tests" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" % 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 bfa25c942c..73919b36e5 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.7.4" +"com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.7.5" ``` 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.7.4" +"com.softwaremill.sttp.client3" %% "scribe-backend" % "3.7.5" ``` \ No newline at end of file diff --git a/generated-docs/out/backends/wrappers/opentelemetry.md b/generated-docs/out/backends/wrappers/opentelemetry.md index 1e3758ea59..131d0cfb63 100644 --- a/generated-docs/out/backends/wrappers/opentelemetry.md +++ b/generated-docs/out/backends/wrappers/opentelemetry.md @@ -12,7 +12,7 @@ The backend depends only on [opentelemetry-api](https://github.com/open-telemetr following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "opentelemetry-metrics-backend" % "3.7.4" +"com.softwaremill.sttp.client3" %% "opentelemetry-metrics-backend" % "3.7.5" ``` Then an instance can be obtained as follows: @@ -53,8 +53,8 @@ OpenTelemetryMetricsBackend( To use, add the following dependency to your project (the `zio-*` modules depend on ZIO 2.x; for ZIO 1.x support, use `zio1-*`): ``` -"com.softwaremill.sttp.client3" %% "opentelemetry-tracing-zio-backend" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %% "opentelemetry-tracing-zio1-backend" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %% "opentelemetry-tracing-zio-backend" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %% "opentelemetry-tracing-zio1-backend" % "3.7.5" // for ZIO 1.x ``` This backend depends on [zio-opentelemetry](https://github.com/zio/zio-telemetry). diff --git a/generated-docs/out/backends/wrappers/prometheus.md b/generated-docs/out/backends/wrappers/prometheus.md index e7074e8bb3..ee5b5f2dd6 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.7.4" +"com.softwaremill.sttp.client3" %% "prometheus-backend" % "3.7.5" ``` and some imports: diff --git a/generated-docs/out/backends/zio.md b/generated-docs/out/backends/zio.md index e04f067fbf..de24db37b9 100644 --- a/generated-docs/out/backends/zio.md +++ b/generated-docs/out/backends/zio.md @@ -9,8 +9,8 @@ The `*-zio` modules depend on ZIO 2.x. For ZIO 1.x support, use modules with the To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "zio" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %% "zio1" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %% "zio" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %% "zio1" % "3.7.5" // for ZIO 1.x ``` Create the backend using: @@ -42,8 +42,8 @@ Host header override is supported in environments running Java 12 onwards, but i To use, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio1" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %% "async-http-client-backend-zio1" % "3.7.5" // for ZIO 1.x ``` 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,8 +84,8 @@ val backend = AsyncHttpClientZioBackend.usingClient(runtime, asyncHttpClient) To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client3" %% "armeria-backend-zio" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %% "armeria-backend-zio1" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %% "armeria-backend-zio" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %% "armeria-backend-zio1" % "3.7.5" // for ZIO 1.x ``` add imports: diff --git a/generated-docs/out/examples.md b/generated-docs/out/examples.md index f27bd62c40..c31531174c 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.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.7.5") ``` Example code: @@ -23,8 +23,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.7.4", - "com.softwaremill.sttp.client3" %% "json4s" % "3.7.4", + "com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.7.5", + "com.softwaremill.sttp.client3" %% "json4s" % "3.7.5", "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.7.4", - "com.softwaremill.sttp.client3" %% "circe" % "3.7.4", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.5", + "com.softwaremill.sttp.client3" %% "circe" % "3.7.5", "io.circe" %% "circe-generic" % "0.14.1" ) ``` @@ -61,8 +61,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.4", - "com.softwaremill.sttp.client3" %% "circe" % "3.7.4", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.5", + "com.softwaremill.sttp.client3" %% "circe" % "3.7.5", "io.circe" %% "circe-generic" % "0.14.1" ) ``` @@ -80,8 +80,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.7.4", - "com.softwaremill.sttp.client3" %% "circe" % "3.7.4", + "com.softwaremill.sttp.client3" %% "slf4j-backend" % "3.7.5", + "com.softwaremill.sttp.client3" %% "circe" % "3.7.5", "io.circe" %% "circe-generic" % "0.14.1" ) ``` @@ -99,8 +99,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.4", - "com.softwaremill.sttp.client3" %% "circe" % "3.7.4", + "com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.5", + "com.softwaremill.sttp.client3" %% "circe" % "3.7.5", "io.circe" %% "circe-generic" % "0.14.1" ) ``` @@ -117,7 +117,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.7.5") ``` Example code: @@ -132,7 +132,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.5") ``` Example code: @@ -147,7 +147,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.5") ``` Example code: @@ -162,7 +162,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.5") ``` Example code: @@ -177,7 +177,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "akka-http-backend" % "3.7.5") ``` Example code: @@ -192,7 +192,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-monix" % "3.7.5") ``` Example code: @@ -207,7 +207,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-fs2" % "3.7.5") ``` Example code: @@ -222,7 +222,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.5") ``` Example code: @@ -237,7 +237,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "async-http-client-backend-zio" % "3.7.5") ``` Example code: @@ -252,7 +252,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.7.4") +libraryDependencies ++= List("com.softwaremill.sttp.client3" %% "core" % "3.7.5") ``` Example code: diff --git a/generated-docs/out/index.md b/generated-docs/out/index.md index 9b4b1ce669..bd043c86c9 100644 --- a/generated-docs/out/index.md +++ b/generated-docs/out/index.md @@ -28,11 +28,7 @@ println(response.header("Content-Length")) // response.body: by default read into an Either[String, String] // to indicate failure or success -println(response.body) - -// alternatively, if you prefer to pass the backend explicitly, instead -// of using implicits, you can also call: -val sameResponse = backend.send(request) +println(response.body) ``` For more examples, see the [usage examples](examples.md) section. To start using sttp client in your project, see the [quickstart](quickstart.md). Or, browse the documentation to find the topics that interest you the most! diff --git a/generated-docs/out/json.md b/generated-docs/out/json.md index 13c97c20b0..ad90b020e3 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.7.4" +"com.softwaremill.sttp.client3" %% "circe" % "3.7.5" ``` 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.7.4" +"com.softwaremill.sttp.client3" %% "json4s" % "3.7.5" "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.7.4" +"com.softwaremill.sttp.client3" %% "spray-json" % "3.7.5" ``` 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.7.4" +"com.softwaremill.sttp.client3" %% "play-json" % "3.7.5" ``` To use, add an import: `import sttp.client3.playJson._`. @@ -144,13 +144,13 @@ To encode and decode JSON using the high-performance [zio-json](https://zio.gith The `zio-json` module depends on ZIO 2.x. For ZIO 1.x support, use `zio1-json`. ```scala -"com.softwaremill.sttp.client3" %% "zio-json" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %% "zio1-json" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %% "zio-json" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %% "zio1-json" % "3.7.5" // for ZIO 1.x ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client3" %%% "zio-json" % "3.7.4" // for ZIO 2.x -"com.softwaremill.sttp.client3" %%% "zio1-json" % "3.7.4" // for ZIO 1.x +"com.softwaremill.sttp.client3" %%% "zio-json" % "3.7.5" // for ZIO 2.x +"com.softwaremill.sttp.client3" %%% "zio1-json" % "3.7.5" // for ZIO 1.x ``` To use, add an import: `import sttp.client3.ziojson._` (or extend `SttpZioJsonApi`), define an implicit `JsonCodec`, or `JsonDecoder`/`JsonEncoder` for your datatype. @@ -182,13 +182,13 @@ basicRequest To encode and decode JSON using the [high(est)-performant](https://plokhotnyuk.github.io/jsoniter-scala/) [jsoniter-scala](https://github.com/plokhotnyuk/jsoniter-scala) library, one add the following dependency to your project. ```scala -"com.softwaremill.sttp.client3" %% "jsoniter-json" % "3.7.4" +"com.softwaremill.sttp.client3" %% "jsoniter-json" % "3.7.5" ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client3" %%% "jsoniter-json" % "3.7.4" +"com.softwaremill.sttp.client3" %%% "jsoniter-json" % "3.7.5" ``` To use, add an import: `import sttp.client3.jsoniter._` (or extend `SttpJsonIterJsonApi`), define an implicit `JsonCodec`, or `JsonDecoder`/`JsonEncoder` for your datatype. diff --git a/generated-docs/out/model/uri.md b/generated-docs/out/model/uri.md index d729901cc3..4dcc44dbeb 100644 --- a/generated-docs/out/model/uri.md +++ b/generated-docs/out/model/uri.md @@ -130,3 +130,42 @@ val jumpTo = Some("section2") println(uri"$scheme://$subdomains.example.com?x=$vx&$paramMap#$jumpTo") // https://sub1.sub2.example.com?x=y+z&a=1&b=2#section2 ``` + +## FAQ: encoding & decoding URI components + +A common question about sttp's `Uri` is why certain characters in various components (path segment, query parameters) +are **not** encoded, even if they are given as encoded when creating the URI. + +The first thing to keep in mind is that internally the URI class stores all components in a **decoded** form. Hence +if you have an URI which in an encoded form has some special characters, such as `/a%20b`, the `Uri` data structure, +which is an ordinary `case class`, will contain a path segment with `a b`. + +When parsing, that includes creating URIs from constant strings e.g. `uri"http://example.com/a%20b"`, all of the +components are decoded and stored in this form. This means that `Uri` might **not** exactly preserve the original +form, in which path segments or query parameters have been writte down (this might change in a future major release, +though). + +When serialising the `Uri` back to a `String`, the code follows the escaping rules defined in +[RFC 3986](https://www.rfc-editor.org/rfc/rfc3986), which specifies the syntax of URIs. + +There, you may find that for example `&` don't have to be escaped in path components, or that `/` don't have to be +escaped in query parameters. Refer to the `Rfc3986` class or the specification for a set of characters, which are +allowed in each context. + +This is often surprising to users, as other libraries and frameworks often escape everything, even if it's not +necessary, regardless of context. + +If for some reason you do require changing the way certain components are encoded, this can be done individually +for every segment (by manually changing the `Uri` case class), or with the `[component]SegmentsEncoding` methods. + +For example, to always encode every non-standard character in query segments: + +```scala +import sttp.model._ +println(uri"http://example.com?a=b/?c%26d".querySegmentsEncoding(Uri.QuerySegmentEncoding.All)) +// http://example.com?a=b%2F%3Fc%26d + +// compare to: +println(uri"http://example.com?a=b/?c%26d") +// http://example.com?a=b/?c%26d +``` \ No newline at end of file diff --git a/generated-docs/out/openapi.md b/generated-docs/out/openapi.md index 98c8c7bd8d..39d28ce0b0 100644 --- a/generated-docs/out/openapi.md +++ b/generated-docs/out/openapi.md @@ -45,8 +45,8 @@ lazy val petstoreApi: Project = project openApiGeneratorName := "scala-sttp", openApiOutputDir := baseDirectory.value.name, libraryDependencies ++= Seq( - "com.softwaremill.sttp.client3" %% "core" % "3.7.4", - "com.softwaremill.sttp.client3" %% "json4s" % "3.7.4", + "com.softwaremill.sttp.client3" %% "core" % "3.7.5", + "com.softwaremill.sttp.client3" %% "json4s" % "3.7.5", "org.json4s" %% "json4s-jackson" % "3.6.8" ) ) @@ -96,8 +96,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.7.4", - "com.softwaremill.sttp.client3" %% "json4s" % "3.7.4", + "com.softwaremill.sttp.client3" %% "core" % "3.7.5", + "com.softwaremill.sttp.client3" %% "json4s" % "3.7.5", "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 0abaec9f4b..9cb4766489 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, together with a synchronous and `Future`-based backends, is: ```scala -"com.softwaremill.sttp.client3" %% "core" % "3.7.4" +"com.softwaremill.sttp.client3" %% "core" % "3.7.5" ``` `sttp client` is available for Scala 2.11, 2.12 and 2.13, as well as for Scala 3 and requires Java 11. @@ -21,7 +21,7 @@ The basic dependency which provides the API, together with a synchronous and `Fu 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.7.4` +import $ivy.`com.softwaremill.sttp.client3::core:3.7.5` 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.7.4` +import $ivy.`com.softwaremill.sttp.client3::okhttp-backend:3.7.5` import sttp.client3.okhttp.quick._ quickRequest.get(uri"http://httpbin.org/ip").send(backend) ```