diff --git a/README.md b/README.md index b6a16c40b3..bf0f158992 100755 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ sttp (v2) documentation is available at [sttp.softwaremill.com/en/v2](https://st 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.client4/core_2.12/4.0.0-M8) +scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client4/core_2.12/4.0.0-M9) ## Quickstart with scala-cli @@ -56,7 +56,7 @@ Add the following directive to the top of your scala file to add the core sttp d If you are using [scala-cli](https://scala-cli.virtuslab.org), you can quickly start experimenting with sttp by copy-pasting the following: ``` -//> using lib "com.softwaremill.sttp.client4::core:4.0.0-M8" +//> using lib "com.softwaremill.sttp.client4::core:4.0.0-M9" import sttp.client4.quick._ quickRequest.get(uri"http://httpbin.org/ip").send() ``` @@ -68,7 +68,7 @@ The `quick` package import brings in the sttp API and a pre-configured, global s Similarly, using [Ammonite](http://ammonite.io): ```scala -import $ivy.`com.softwaremill.sttp.client4::core:4.0.0-M8` +import $ivy.`com.softwaremill.sttp.client4::core:4.0.0-M9` import sttp.client4.quick._ quickRequest.get(uri"http://httpbin.org/ip").send() ``` @@ -78,7 +78,7 @@ quickRequest.get(uri"http://httpbin.org/ip").send() Add the following dependency: ```scala -"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" ``` Then, import: @@ -133,7 +133,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 := "4.0.0-M8"`, before running `mdoc` in `docs`. +That is, in sbt run: `set version := "4.0.0-M9"`, before running `mdoc` in `docs`. ### Testing the Scala.JS backend @@ -160,4 +160,4 @@ We offer commercial support for sttp and related technologies, as well as develo ## Copyright -Copyright (C) 2017-2023 SoftwareMill [https://softwaremill.com](https://softwaremill.com). +Copyright (C) 2017-2024 SoftwareMill [https://softwaremill.com](https://softwaremill.com). diff --git a/build.sbt b/build.sbt index f82296eff4..5059bb0727 100644 --- a/build.sbt +++ b/build.sbt @@ -121,13 +121,13 @@ val testServerSettings = Seq( val circeVersion: String = "0.14.6" -val jsoniterVersion = "2.25.0" +val jsoniterVersion = "2.27.2" -val play29JsonVersion = "2.10.3" +val play29JsonVersion = "2.10.4" -val playJsonVersion = "3.0.1" +val playJsonVersion = "3.0.2" -val catsEffect_3_version = "3.5.2" +val catsEffect_3_version = "3.5.3" val fs2_3_version = "3.9.4" val catsEffect_2_version = "2.5.5" @@ -138,32 +138,32 @@ val akkaHttp = "com.typesafe.akka" %% "akka-http" % "10.2.10" val akkaStreamVersion = "2.6.20" val akkaStreams = "com.typesafe.akka" %% "akka-stream" % akkaStreamVersion -val pekkoHttp = "org.apache.pekko" %% "pekko-http" % "1.0.0" +val pekkoHttp = "org.apache.pekko" %% "pekko-http" % "1.0.1" val pekkoStreamVersion = "1.0.2" val pekkoStreams = "org.apache.pekko" %% "pekko-stream" % pekkoStreamVersion val scalaTest = libraryDependencies ++= Seq("freespec", "funsuite", "flatspec", "wordspec", "shouldmatchers").map(m => - "org.scalatest" %%% s"scalatest-$m" % "3.2.17" % Test + "org.scalatest" %%% s"scalatest-$m" % "3.2.18" % Test ) val zio1Version = "1.0.18" -val zio2Version = "2.0.19" +val zio2Version = "2.0.21" val zio1InteropRsVersion = "1.3.12" val zio2InteropRsVersion = "2.0.2" val sttpModelVersion = "1.7.6" val sttpSharedVersion = "1.3.17" -val logback = "ch.qos.logback" % "logback-classic" % "1.4.14" +val logback = "ch.qos.logback" % "logback-classic" % "1.5.0" val jeagerClientVersion = "1.8.1" -val braveOpentracingVersion = "1.0.0" +val braveOpentracingVersion = "1.0.1" val zipkinSenderOkHttpVersion = "2.16.5" -val resilience4jVersion = "2.1.0" +val resilience4jVersion = "2.2.0" val http4s_ce2_version = "0.22.15" val http4s_ce3_version = "0.23.24" -val openTelemetryVersion = "1.33.0" +val openTelemetryVersion = "1.35.0" val compileAndTest = "compile->compile;test->test" @@ -676,7 +676,7 @@ lazy val http4sBackend = (projectMatrix in file("http4s-backend")) libraryDependencies ++= Seq( "org.http4s" %% "http4s-client" % http4s_ce3_version, "org.http4s" %% "http4s-ember-client" % "0.23.24" % Optional, - "org.http4s" %% "http4s-blaze-client" % "0.23.15" % Optional + "org.http4s" %% "http4s-blaze-client" % "0.23.16" % Optional ), evictionErrorLevel := Level.Info ) @@ -701,7 +701,7 @@ lazy val armeriaBackend = (projectMatrix in file("armeria-backend")) .settings(testServerSettings) .settings( name := "armeria-backend", - libraryDependencies += "com.linecorp.armeria" % "armeria" % "1.26.4" + libraryDependencies += "com.linecorp.armeria" % "armeria" % "1.27.1" ) .jvmPlatform(scalaVersions = scala2 ++ scala3) .dependsOn(core % compileAndTest) @@ -847,7 +847,7 @@ lazy val upickle = (projectMatrix in file("json/upickle")) .settings( name := "upickle", libraryDependencies ++= Seq( - "com.lihaoyi" %%% "upickle" % "3.1.3" + "com.lihaoyi" %%% "upickle" % "3.1.4" ), scalaTest, // using macroRW causes a "match may not be exhaustive" error diff --git a/core/src/main/scalajs/sttp/client4/fetch/AbstractFetchBackend.scala b/core/src/main/scalajs/sttp/client4/fetch/AbstractFetchBackend.scala index af09ce1a9e..17532b4817 100644 --- a/core/src/main/scalajs/sttp/client4/fetch/AbstractFetchBackend.scala +++ b/core/src/main/scalajs/sttp/client4/fetch/AbstractFetchBackend.scala @@ -84,20 +84,21 @@ abstract class AbstractFetchBackend[F[_], S <: Streams[S]]( private def sendRegular[T](request: GenericRequest[T, R]): F[Response[T]] = { // https://stackoverflow.com/q/31061838/4094860 val readTimeout = request.options.readTimeout - val (signal, cancelTimeout) = readTimeout match { + val controller = new AbortController() + val signal = controller.signal + val cancelTimeout = readTimeout match { case timeout: FiniteDuration => - val controller = new AbortController() - val signal = controller.signal - val timeoutHandle = setTimeout(timeout) { controller.abort() } - (Some(signal), () => clearTimeout(timeoutHandle)) + () => clearTimeout(timeoutHandle) case _ => - (None, () => ()) + () => () } + val cancel = () => controller.abort() + val rheaders = new JSHeaders() request.headers.foreach { header => // for multipart/form-data requests dom.FormData is responsible for setting the Content-Type header @@ -113,7 +114,7 @@ abstract class AbstractFetchBackend[F[_], S <: Streams[S]]( val req = createBody(request.body).map { rbody => // use manual so we can return a specific error instead of the generic "TypeError: Failed to fetch" val rredirect = if (request.options.followRedirects) RequestRedirect.follow else RequestRedirect.manual - val rsignal = signal.orUndefined + val rsignal = signal val requestInitStatic = new RequestInit() { this.method = request.method.method.asInstanceOf[HttpMethod] @@ -132,7 +133,7 @@ abstract class AbstractFetchBackend[F[_], S <: Streams[S]]( } val requestInitDynamic = requestInitStatic.asInstanceOf[js.Dynamic] - signal.foreach(s => requestInitDynamic.updateDynamic("signal")(s)) + requestInitDynamic.updateDynamic("signal")(signal) requestInitDynamic.updateDynamic("redirect")(rredirect) // named wrong in RequestInit val requestInit = requestInitDynamic.asInstanceOf[RequestInit] @@ -165,10 +166,10 @@ abstract class AbstractFetchBackend[F[_], S <: Streams[S]]( ) } } - addCancelTimeoutHook(result, cancelTimeout) + addCancelTimeoutHook(result, cancel, cancelTimeout) } - protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit): F[T] + protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit, cleanup: () => Unit): F[T] private def convertResponseHeaders(headers: JSHeaders): Seq[Header] = headers diff --git a/core/src/main/scalajs/sttp/client4/fetch/FetchBackend.scala b/core/src/main/scalajs/sttp/client4/fetch/FetchBackend.scala index 912bf0379a..b776378eee 100644 --- a/core/src/main/scalajs/sttp/client4/fetch/FetchBackend.scala +++ b/core/src/main/scalajs/sttp/client4/fetch/FetchBackend.scala @@ -16,8 +16,12 @@ class FetchBackend private (fetchOptions: FetchOptions, customizeRequest: FetchR override val streams: NoStreams = NoStreams - override protected def addCancelTimeoutHook[T](result: Future[T], cancel: () => Unit): Future[T] = { - result.onComplete(_ => cancel()) + override protected def addCancelTimeoutHook[T]( + result: Future[T], + cancel: () => Unit, + cleanup: () => Unit + ): Future[T] = { + result.onComplete(_ => cleanup()) result } diff --git a/docs/index.md b/docs/index.md index 0e458a50a5..fa260588a4 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,7 +33,7 @@ println(response.header("Content-Length")) 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! +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! ScalaDoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client4/core_2.12/4.0.0-M9). ## Other sttp projects @@ -56,7 +56,7 @@ Third party projects: ## Sponsors -Development and maintenance of sttp client is sponsored by [SoftwareMill](https://softwaremill.com), a software development and consulting company. We help clients scale their business through software. Our areas of expertise include backends, distributed systems, blockchain, machine learning and data analytics. +Development and maintenance of sttp client is sponsored by [SoftwareMill](https://softwaremill.com), a software development and consulting company. We help clients scale their business through software. Our areas of expertise include backends, distributed systems, machine learning, platform engineering and data analytics. [![](https://files.softwaremill.com/logo/logo.png "SoftwareMill")](https://softwaremill.com) diff --git a/docs/model/uri.md b/docs/model/uri.md index 5fa466e453..84e5d20d7c 100644 --- a/docs/model/uri.md +++ b/docs/model/uri.md @@ -35,7 +35,7 @@ import sttp.client4._ // the embedded / is escaped println(uri"http://example.org/${"a/b"}") -// the embedded / is not escaped +// the literal / is not escaped println(uri"http://example.org/${"a"}/${"b"}") // the embedded : is not escaped @@ -132,7 +132,7 @@ 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, +form, in which path segments or query parameters have been written 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 @@ -156,4 +156,4 @@ println(uri"http://example.com?a=b/?c%26d".querySegmentsEncoding(Uri.QuerySegmen // compare to: println(uri"http://example.com?a=b/?c%26d") -``` \ No newline at end of file +``` diff --git a/effects/cats-ce2/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala b/effects/cats-ce2/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala index d274cafa14..fa1d78fc5b 100644 --- a/effects/cats-ce2/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala +++ b/effects/cats-ce2/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala @@ -19,9 +19,10 @@ class FetchCatsBackend[F[_]: Concurrent: ContextShift] private ( override val streams: NoStreams = NoStreams - override protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit): F[T] = { + override protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit, cleanup: () => Unit): F[T] = { val doCancel = Sync[F].delay(cancel()) - result.guarantee(doCancel) + val doCleanup = Sync[F].delay(cleanup()) + result.onCancel(doCancel).guarantee(doCleanup) } override protected def handleStreamBody(s: Nothing): F[js.UndefOr[BodyInit]] = s diff --git a/effects/cats/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala b/effects/cats/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala index 3a7fe31896..25a6861fd9 100644 --- a/effects/cats/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala +++ b/effects/cats/src/main/scalajs/sttp/client4/impl/cats/FetchCatsBackend.scala @@ -19,9 +19,10 @@ class FetchCatsBackend[F[_]: Async] private ( override val streams: NoStreams = NoStreams - override protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit): F[T] = { + override protected def addCancelTimeoutHook[T](result: F[T], cancel: () => Unit, cleanup: () => Unit): F[T] = { val doCancel = Async[F].delay(cancel()) - result.guarantee(doCancel) + val doCleanup = Async[F].delay(cleanup()) + result.onCancel(doCancel).guarantee(doCleanup) } override protected def handleStreamBody(s: Nothing): F[js.UndefOr[BodyInit]] = s diff --git a/effects/monix/src/main/scalajs/sttp/client4/impl/monix/FetchMonixBackend.scala b/effects/monix/src/main/scalajs/sttp/client4/impl/monix/FetchMonixBackend.scala index 63e702aabb..7b59bd2711 100644 --- a/effects/monix/src/main/scalajs/sttp/client4/impl/monix/FetchMonixBackend.scala +++ b/effects/monix/src/main/scalajs/sttp/client4/impl/monix/FetchMonixBackend.scala @@ -29,9 +29,10 @@ class FetchMonixBackend private (fetchOptions: FetchOptions, customizeRequest: F override val streams: MonixStreams = MonixStreams - override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit): Task[T] = { + override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit, cleanup: () => Unit): Task[T] = { val doCancel = Task.delay(cancel()) - result.doOnCancel(doCancel).doOnFinish(_ => doCancel) + val doCleanup = Task.delay(cleanup()) + result.doOnCancel(doCancel).doOnFinish(_ => doCleanup) } override protected def handleStreamBody(s: Observable[Array[Byte]]): Task[js.UndefOr[BodyInit]] = { diff --git a/effects/zio/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala b/effects/zio/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala index f357d6a82b..f59b99f9f1 100644 --- a/effects/zio/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala +++ b/effects/zio/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala @@ -32,9 +32,10 @@ class FetchZioBackend private (fetchOptions: FetchOptions, customizeRequest: Fet override val streams: ZioStreams = ZioStreams - override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit): Task[T] = { - val doCancel = ZIO.attempt(cancel()) - result.onInterrupt(doCancel.catchAll(_ => ZIO.unit)).tap(_ => doCancel) + override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit, cleanup: () => Unit): Task[T] = { + val doCancel = ZIO.attempt(cancel()).ignore + val doCleanup = ZIO.attempt(cleanup()).ignore + result.onInterrupt(doCancel).onExit(_ => doCleanup) } override protected def handleStreamBody(s: Observable[Byte]): Task[js.UndefOr[BodyInit]] = { diff --git a/effects/zio1/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala b/effects/zio1/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala index 36c275bdce..8712d48c30 100644 --- a/effects/zio1/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala +++ b/effects/zio1/src/main/scalajs/sttp/client4/impl/zio/FetchZioBackend.scala @@ -37,9 +37,10 @@ class FetchZioBackend private (fetchOptions: FetchOptions, customizeRequest: Fet override val streams: ZioStreams = ZioStreams - override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit): Task[T] = { - val doCancel = ZIO.effect(cancel()) - result.onInterrupt(doCancel.catchAll(_ => ZIO.unit)).tap(_ => doCancel) + override protected def addCancelTimeoutHook[T](result: Task[T], cancel: () => Unit, cleanup: () => Unit): Task[T] = { + val doCancel = ZIO.effect(cancel()).ignore + val doCleanup = ZIO.effect(cleanup()).ignore + result.onInterrupt(doCancel).onExit(_ => doCleanup) } override protected def handleStreamBody(s: Observable[Byte]): Task[js.UndefOr[BodyInit]] = { diff --git a/generated-docs/out/backends/akka.md b/generated-docs/out/backends/akka.md index b1dff5e184..f638b4372e 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.client4" %% "akka-http-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "akka-http-backend" % "4.0.0-M9" ``` 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 98ea0a92be..5604609cc7 100644 --- a/generated-docs/out/backends/catseffect.md +++ b/generated-docs/out/backends/catseffect.md @@ -14,7 +14,7 @@ Also note that the [http4s](http4s.md) backend can also be created for a type im Firstly, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "cats" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "cats" % "4.0.0-M9" ``` Obtain a cats-effect `Resource` which creates the backend, and closes the thread pool after the resource is no longer used: @@ -82,9 +82,9 @@ Creation of the backend can be done in two basic ways: Firstly, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "armeria-backend-cats" % "4.0.0-M8" // for cats-effect 3.x +"com.softwaremill.sttp.client4" %% "armeria-backend-cats" % "4.0.0-M9" // for cats-effect 3.x // or -"com.softwaremill.sttp.client4" %% "armeria-backend-cats-ce2" % "4.0.0-M8" // for cats-effect 2.x +"com.softwaremill.sttp.client4" %% "armeria-backend-cats-ce2" % "4.0.0-M9" // for cats-effect 2.x ``` create client: diff --git a/generated-docs/out/backends/finagle.md b/generated-docs/out/backends/finagle.md index 351339818e..ccfdf1def0 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.client4" %% "finagle-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "finagle-backend" % "4.0.0-M9" ``` 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 1160461735..f99e036c68 100644 --- a/generated-docs/out/backends/fs2.md +++ b/generated-docs/out/backends/fs2.md @@ -12,9 +12,9 @@ Creation of the backend can be done in two basic ways: Firstly, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M8" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M9" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client4" %% "fs2ce2" % "4.0.0-M8" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client4" %% "fs2ce2" % "4.0.0-M9" // 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: @@ -78,9 +78,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.client4" %% "armeria-backend-fs2" % "4.0.0-M8" // for cats-effect 3.x & fs2 3.x +"com.softwaremill.sttp.client4" %% "armeria-backend-fs2" % "4.0.0-M9" // for cats-effect 3.x & fs2 3.x // or -"com.softwaremill.sttp.client4" %% "armeria-backend-fs2" % "4.0.0-M8" // for cats-effect 2.x & fs2 2.x +"com.softwaremill.sttp.client4" %% "armeria-backend-fs2" % "4.0.0-M9" // 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 d216731be3..342f67df75 100644 --- a/generated-docs/out/backends/future.md +++ b/generated-docs/out/backends/future.md @@ -20,7 +20,7 @@ Class Supported stream type To use, you don't need any extra dependencies, `core` is enough: ``` -"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" ``` 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.client4" %% "okhttp-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "okhttp-backend" % "4.0.0-M9" ``` and some imports: @@ -91,7 +91,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.client4" %% "armeria-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "armeria-backend" % "4.0.0-M9" ``` add imports: diff --git a/generated-docs/out/backends/http4s.md b/generated-docs/out/backends/http4s.md index 347af7ce2d..b5e2dd1edc 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.client4" %% "http4s-backend" % "4.0.0-M8" // for cats-effect 3.x & http4s 1.0.0-Mx +"com.softwaremill.sttp.client4" %% "http4s-backend" % "4.0.0-M9" // for cats-effect 3.x & http4s 1.0.0-Mx // or -"com.softwaremill.sttp.client4" %% "http4s-ce2-backend" % "4.0.0-M8" // for cats-effect 2.x & http4s 0.21.x +"com.softwaremill.sttp.client4" %% "http4s-ce2-backend" % "4.0.0-M9" // 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 d04dd79f70..d207e4ec92 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.client4" %%% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "core" % "4.0.0-M9" ``` 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.client4" %%% "monix" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "monix" % "4.0.0-M9" ``` And create the backend instance: @@ -40,7 +40,7 @@ val backend = FetchMonixBackend() To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %%% "zio" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "zio" % "4.0.0-M9" ``` 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.client4" %%% "cats" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "cats" % "4.0.0-M9" ``` If you are on Cats Effect 2 (CE2) you will need to add the CE2 specific dependency instead: ``` -"com.softwaremill.sttp.client4" %%% "catsce2 % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "catsce2 % "4.0.0-M9" ``` 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.client4" %%% "monix" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "monix" % "4.0.0-M9" ``` An example of streaming a response: diff --git a/generated-docs/out/backends/monix.md b/generated-docs/out/backends/monix.md index ee4e6744dc..30a69767ac 100644 --- a/generated-docs/out/backends/monix.md +++ b/generated-docs/out/backends/monix.md @@ -12,7 +12,7 @@ Creation of the backend can be done in two basic ways: Firstly, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M9" ``` and create the backend using: @@ -50,7 +50,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.client4" %% "okhttp-backend-monix" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "okhttp-backend-monix" % "4.0.0-M9" ``` 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.client4" %% "armeria-backend-monix" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "armeria-backend-monix" % "4.0.0-M9" ``` add imports: diff --git a/generated-docs/out/backends/native/curl.md b/generated-docs/out/backends/native/curl.md index e587cf8a7a..2e658fea91 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.client4" %%% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "core" % "4.0.0-M9" ``` and initialize one of the backends: diff --git a/generated-docs/out/backends/pekko.md b/generated-docs/out/backends/pekko.md index ee98401d1a..ba5d5b795d 100644 --- a/generated-docs/out/backends/pekko.md +++ b/generated-docs/out/backends/pekko.md @@ -3,7 +3,7 @@ This backend is based on [pekko-http](https://pekko.apache.org/docs/pekko-http/current/). To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "pekko-http-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "pekko-http-backend" % "4.0.0-M9" ``` 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 Pekko. diff --git a/generated-docs/out/backends/scalaz.md b/generated-docs/out/backends/scalaz.md index baad93097e..29ad261051 100644 --- a/generated-docs/out/backends/scalaz.md +++ b/generated-docs/out/backends/scalaz.md @@ -8,7 +8,7 @@ The [Scalaz](https://github.com/scalaz/scalaz) backend is **asynchronous**. Send To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "armeria-backend-scalaz" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "armeria-backend-scalaz" % "4.0.0-M9" ``` add imports: diff --git a/generated-docs/out/backends/synchronous.md b/generated-docs/out/backends/synchronous.md index f0df8327f6..6d5f8d745d 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.client4" %% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" ``` 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.client4" %% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" ``` 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.client4" %% "okhttp-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "okhttp-backend" % "4.0.0-M9" ``` Create the backend using: diff --git a/generated-docs/out/backends/wrappers/custom.md b/generated-docs/out/backends/wrappers/custom.md index eccda7d7ba..e16c53f336 100644 --- a/generated-docs/out/backends/wrappers/custom.md +++ b/generated-docs/out/backends/wrappers/custom.md @@ -260,7 +260,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.client4" %% "core" % "4.0.0-M8" % Test classifier "tests" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" % Test classifier "tests" ``` Implement your backend and extend the `HttpTest` class: @@ -290,9 +290,9 @@ import sttp.client4.impl.cats.implicits._ from the cats integration module. The module should be available on the classpath after adding following dependency: ```scala -"com.softwaremill.sttp.client4" %% "cats" % "4.0.0-M8" // for cats-effect 3.x +"com.softwaremill.sttp.client4" %% "cats" % "4.0.0-M9" // for cats-effect 3.x // or -"com.softwaremill.sttp.client4" %% "catsce2" % "4.0.0-M8" // for cats-effect 2.x +"com.softwaremill.sttp.client4" %% "catsce2" % "4.0.0-M9" // for cats-effect 2.x ``` The object contains implicits to convert a cats `MonadError` into the sttp `MonadError`, diff --git a/generated-docs/out/backends/wrappers/logging.md b/generated-docs/out/backends/wrappers/logging.md index a9f5a2ae68..ff5ecd6b3e 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.client4" %% "slf4j-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "slf4j-backend" % "4.0.0-M9" ``` 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.client4" %% "scribe-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "scribe-backend" % "4.0.0-M9" ``` \ 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 caa819910d..3d95993d94 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.client4" %% "opentelemetry-metrics-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "opentelemetry-metrics-backend" % "4.0.0-M9" ``` Then an instance can be obtained as follows: @@ -55,7 +55,7 @@ OpenTelemetryMetricsBackend( To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "opentelemetry-tracing-zio-backend" % "4.0.0-M8" // for ZIO 2.x +"com.softwaremill.sttp.client4" %% "opentelemetry-tracing-zio-backend" % "4.0.0-M9" // for ZIO 2.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 e29ba3254a..419d8cedb2 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.client4" %% "prometheus-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "prometheus-backend" % "4.0.0-M9" ``` and some imports: diff --git a/generated-docs/out/backends/zio.md b/generated-docs/out/backends/zio.md index fccbda50e8..d37538a6b0 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.client4" %% "zio" % "4.0.0-M8" // for ZIO 2.x -"com.softwaremill.sttp.client4" %% "zio1" % "4.0.0-M8" // for ZIO 1.x +"com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M9" // for ZIO 2.x +"com.softwaremill.sttp.client4" %% "zio1" % "4.0.0-M9" // for ZIO 1.x ``` Create the backend using: @@ -45,8 +45,8 @@ Host header override is supported in environments running Java 12 onwards, but i To use, add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "armeria-backend-zio" % "4.0.0-M8" // for ZIO 2.x -"com.softwaremill.sttp.client4" %% "armeria-backend-zio1" % "4.0.0-M8" // for ZIO 1.x +"com.softwaremill.sttp.client4" %% "armeria-backend-zio" % "4.0.0-M9" // for ZIO 2.x +"com.softwaremill.sttp.client4" %% "armeria-backend-zio1" % "4.0.0-M9" // for ZIO 1.x ``` add imports: diff --git a/generated-docs/out/examples.md b/generated-docs/out/examples.md index 9f25957d6d..edceb1a584 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.client4" %% "core" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9") ``` Example code: @@ -22,7 +22,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9") ``` Example code: @@ -38,8 +38,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client4" %% "akka-http-backend" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "akka-http-backend" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M9", "org.json4s" %% "json4s-native" % "3.6.0" ) ``` @@ -57,8 +57,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M9", "io.circe" %% "circe-generic" % "0.14.6" ) ``` @@ -76,8 +76,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M9", "io.circe" %% "circe-generic" % "0.14.6" ) ``` @@ -95,8 +95,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client4" %% "slf4j-backend" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "slf4j-backend" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M9", "io.circe" %% "circe-generic" % "0.14.6" ) ``` @@ -114,8 +114,8 @@ Required dependencies: ```scala libraryDependencies ++= List( - "com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M9", "io.circe" %% "circe-generic" % "0.14.6" ) ``` @@ -132,7 +132,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9") ``` Example code: @@ -146,7 +146,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M9") ``` Example code: @@ -161,7 +161,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M9") ``` Example code: @@ -176,7 +176,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M9") ``` Example code: @@ -191,7 +191,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "akka-http-backend" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "akka-http-backend" % "4.0.0-M9") ``` Example code: @@ -206,7 +206,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "pekko-http-backend" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "pekko-http-backend" % "4.0.0-M9") ``` Example code: @@ -221,7 +221,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "monix" % "4.0.0-M9") ``` Example code: @@ -236,7 +236,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "fs2" % "4.0.0-M9") ``` Example code: @@ -251,7 +251,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M9") ``` Example code: @@ -266,7 +266,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "zio" % "4.0.0-M9") ``` Example code: @@ -281,7 +281,7 @@ Example code: Required dependencies: ```scala -libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8") +libraryDependencies ++= List("com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9") ``` Example code: diff --git a/generated-docs/out/json.md b/generated-docs/out/json.md index 0fe0321a6c..9eedb4a3c3 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.client4" %% "circe" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "circe" % "4.0.0-M9" ``` 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.client4" %% "json4s" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M9" "org.json4s" %% "json4s-native" % "3.6.0" ``` @@ -100,7 +100,7 @@ val response: Response[Either[ResponseException[String, Exception], ResponsePayl To encode and decode JSON using [spray-json](https://github.com/spray/spray-json), add the following dependency to your project: ``` -"com.softwaremill.sttp.client4" %% "spray-json" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "spray-json" % "4.0.0-M9" ``` 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,13 +132,13 @@ val response: Response[Either[ResponseException[String, Exception], ResponsePayl To encode and decode JSON using [play-json](https://www.playframework.com), add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "play-json" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "play-json" % "4.0.0-M9" ``` If you use older version of play (2.9.x), add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "play29-json" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "play29-json" % "4.0.0-M9" ``` To use, add an import: `import sttp.client4.playJson._`. @@ -150,13 +150,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.client4" %% "zio-json" % "4.0.0-M8" // for ZIO 2.x -"com.softwaremill.sttp.client4" %% "zio1-json" % "4.0.0-M8" // for ZIO 1.x +"com.softwaremill.sttp.client4" %% "zio-json" % "4.0.0-M9" // for ZIO 2.x +"com.softwaremill.sttp.client4" %% "zio1-json" % "4.0.0-M9" // for ZIO 1.x ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client4" %%% "zio-json" % "4.0.0-M8" // for ZIO 2.x -"com.softwaremill.sttp.client4" %%% "zio1-json" % "4.0.0-M8" // for ZIO 1.x +"com.softwaremill.sttp.client4" %%% "zio-json" % "4.0.0-M9" // for ZIO 2.x +"com.softwaremill.sttp.client4" %%% "zio1-json" % "4.0.0-M9" // for ZIO 1.x ``` To use, add an import: `import sttp.client4.ziojson._` (or extend `SttpZioJsonApi`), define an implicit `JsonCodec`, or `JsonDecoder`/`JsonEncoder` for your datatype. @@ -188,13 +188,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.client4" %% "jsoniter" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "jsoniter" % "4.0.0-M9" ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client4" %%% "jsoniter" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "jsoniter" % "4.0.0-M9" ``` To use, add an import: `import sttp.client4.jsoniter._` (or extend `SttpJsonIterJsonApi`), define an implicit `JsonCodec`, or `JsonDecoder`/`JsonEncoder` for your datatype. @@ -228,13 +228,13 @@ basicRequest To encode and decode JSON using the [uPickle](https://github.com/com-lihaoyi/upickle) library, add the following dependency to your project: ```scala -"com.softwaremill.sttp.client4" %% "upickle" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "upickle" % "4.0.0-M9" ``` or for ScalaJS (cross build) projects: ```scala -"com.softwaremill.sttp.client4" %%% "upickle" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %%% "upickle" % "4.0.0-M9" ``` To use, add an import: `import sttp.client4.upicklejson.default._` and define an implicit `ReadWriter` (or separately `Reader` and `Writer`) for your datatype. diff --git a/generated-docs/out/model/uri.md b/generated-docs/out/model/uri.md index ef146a4bbb..62b75f91f4 100644 --- a/generated-docs/out/model/uri.md +++ b/generated-docs/out/model/uri.md @@ -36,7 +36,7 @@ import sttp.client4._ println(uri"http://example.org/${"a/b"}") // http://example.org/a%2Fb -// the embedded / is not escaped +// the literal / is not escaped println(uri"http://example.org/${"a"}/${"b"}") // http://example.org/a/b @@ -142,7 +142,7 @@ 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, +form, in which path segments or query parameters have been written 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 @@ -168,4 +168,4 @@ println(uri"http://example.com?a=b/?c%26d".querySegmentsEncoding(Uri.QuerySegmen // 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 71b4173330..5f0923ed57 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.client4" %% "core" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M9", "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.client4" %% "core" % "4.0.0-M8", - "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M8", + "com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9", + "com.softwaremill.sttp.client4" %% "json4s" % "4.0.0-M9", "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 f56fb48aa3..dd0f0bed6d 100644 --- a/generated-docs/out/quickstart.md +++ b/generated-docs/out/quickstart.md @@ -15,7 +15,7 @@ platforms, and that each has its own dedicated set of backends. The basic dependency which provides the API, together with a synchronous and `Future`-based backends, is: ```scala -"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M9" ``` ## Using scala-cli @@ -23,7 +23,7 @@ The basic dependency which provides the API, together with a synchronous and `Fu Add the following directive to the top of your scala file to add the core sttp dependency: ``` -//> using lib "com.softwaremill.sttp.client4::core:4.0.0-M8" +//> using lib "com.softwaremill.sttp.client4::core:4.0.0-M9" ``` ## Using Ammonite @@ -31,7 +31,7 @@ Add the following directive to the top of your scala file to add the core sttp d 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.client4::core:4.0.0-M8` +import $ivy.`com.softwaremill.sttp.client4::core:4.0.0-M9` ``` ## Imports @@ -72,7 +72,7 @@ As an example, to integrate with the [uPickle](https://github.com/com-lihaoyi/up dependency: ```scala -"com.softwaremill.sttp.client4" %% "upickle" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "upickle" % "4.0.0-M9" ``` Your code might then look as follows: @@ -109,7 +109,7 @@ Logging can be added using the [logging backend wrapper](backends/wrappers/loggi use slf4j, you'll need the following dependency: ``` -"com.softwaremill.sttp.client4" %% "slf4j-backend" % "4.0.0-M8" +"com.softwaremill.sttp.client4" %% "slf4j-backend" % "4.0.0-M9" ``` Then, you'll need to configure your client: diff --git a/project/build.properties b/project/build.properties index d415199524..04267b14af 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.7 \ No newline at end of file +sbt.version=1.9.9 diff --git a/project/plugins.sbt b/project/plugins.sbt index b80b6c2fab..e5265f4377 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,15 +1,15 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.14.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.15.0") addSbtPlugin("org.scala-js" % "sbt-jsdependencies" % "1.0.2") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.16") +addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.17") addSbtPlugin("io.spray" % "sbt-revolver" % "0.10.0") -addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.1") +addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.9.2") -val sbtSoftwareMillVersion = "2.0.18" +val sbtSoftwareMillVersion = "2.0.19" addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion) addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion) addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion) -addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.1") +addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.5.2") addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.2") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")