Skip to content

Commit

Permalink
Merge branch 'master' into update/async-http-client-3.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adamw authored Dec 16, 2024
2 parents 8ebf712 + 067e78c commit 4041706
Show file tree
Hide file tree
Showing 92 changed files with 1,722 additions and 843 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ 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-M19)
scaladoc is available at [https://www.javadoc.io](https://www.javadoc.io/doc/com.softwaremill.sttp.client4/core_2.12/4.0.0-M20)

## Quickstart with scala-cli

Add the following directive to the top of your scala file to add the core sttp dependency:
If you are using [scala-cli](https://scala-cli.virtuslab.org), you can quickly start experimenting with sttp by copy-pasting the following:

```
//> using dep "com.softwaremill.sttp.client4::core:4.0.0-M19"
//> using dep "com.softwaremill.sttp.client4::core:4.0.0-M20"
import sttp.client4.quick._
quickRequest.get(uri"http://httpbin.org/ip").send()
```
Expand All @@ -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-M19`
import $ivy.`com.softwaremill.sttp.client4::core:4.0.0-M20`
import sttp.client4.quick._
quickRequest.get(uri"http://httpbin.org/ip").send()
```
Expand All @@ -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-M19"
"com.softwaremill.sttp.client4" %% "core" % "4.0.0-M20"
```

Then, import:
Expand Down Expand Up @@ -135,7 +135,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-M19"`, before running `mdoc` in `docs`.
That is, in sbt run: `set version := "4.0.0-M20"`, before running `mdoc` in `docs`.

### Testing the Scala.JS backend

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ package sttp.client4.asynchttpclient.zio
import sttp.client4._
import sttp.client4.asynchttpclient.AsyncHttpClientHttpTest
import sttp.client4.impl.zio.ZioTestBase
import sttp.client4.testing.{ConvertToFuture, HttpTest}
import zio.{Task, ZIO}
import sttp.client4.testing.ConvertToFuture
import zio.Task
import zio.ZIO

class AsyncHttpClientZioHttpTest extends AsyncHttpClientHttpTest[Task] with ZioTestBase {

Expand Down
39 changes: 20 additions & 19 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ val testServerSettings = Seq(

val circeVersion: String = "0.14.10"

val jsoniterVersion = "2.31.3"
val jsoniterVersion = "2.32.0"

val play29JsonVersion = "2.10.6"

Expand Down Expand Up @@ -152,20 +152,20 @@ val zio2InteropRsVersion = "2.0.2"

val oxVersion = "0.5.1"
val sttpModelVersion = "1.7.11"
val sttpSharedVersion = "1.4.0"
val sttpSharedVersion = "1.4.2"

val logback = "ch.qos.logback" % "logback-classic" % "1.5.12"

val jaegerClientVersion = "1.8.1"
val braveOpentracingVersion = "1.0.1"
val zipkinSenderOkHttpVersion = "3.4.2"
val zipkinSenderOkHttpVersion = "3.4.3"
val resilience4jVersion = "2.2.0"
val http4s_ce2_version = "0.22.15"
val http4s_ce3_version = "0.23.29"
val http4s_ce3_version = "0.23.30"

val tethysVersion = "0.29.3"

val openTelemetryVersion = "1.44.1"
val openTelemetryVersion = "1.45.0"

val compileAndTest = "compile->compile;test->test"

Expand Down Expand Up @@ -708,7 +708,7 @@ lazy val http4sBackend = (projectMatrix in file("http4s-backend"))
name := "http4s-backend",
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-client" % http4s_ce3_version,
"org.http4s" %% "http4s-ember-client" % "0.23.29" % Optional,
"org.http4s" %% "http4s-ember-client" % "0.23.30" % Optional,
"org.http4s" %% "http4s-blaze-client" % "0.23.17" % Optional
),
evictionErrorLevel := Level.Info
Expand All @@ -734,7 +734,7 @@ lazy val armeriaBackend = (projectMatrix in file("armeria-backend"))
.settings(testServerSettings)
.settings(
name := "armeria-backend",
libraryDependencies += "com.linecorp.armeria" % "armeria" % "1.31.1"
libraryDependencies += "com.linecorp.armeria" % "armeria" % "1.31.3"
)
.jvmPlatform(scalaVersions = scala2 ++ scala3)
.dependsOn(core % compileAndTest)
Expand Down Expand Up @@ -800,7 +800,8 @@ lazy val armeriaZioBackend =
//----- json
lazy val jsonCommon = (projectMatrix in (file("json/common")))
.settings(
name := "json-common"
name := "json-common",
scalaTest
)
.jvmPlatform(
scalaVersions = scala2 ++ scala3,
Expand All @@ -826,7 +827,7 @@ lazy val circe = (projectMatrix in file("json/circe"))
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.nativePlatform(scalaVersions = scala2 ++ scala3, settings = commonNativeSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val jsoniter = (projectMatrix in file("json/jsoniter"))
.settings(
Expand All @@ -842,7 +843,7 @@ lazy val jsoniter = (projectMatrix in file("json/jsoniter"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val zioJson = (projectMatrix in file("json/zio-json"))
.settings(
Expand All @@ -858,7 +859,7 @@ lazy val zioJson = (projectMatrix in file("json/zio-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val zio1Json = (projectMatrix in file("json/zio1-json"))
.settings(
Expand All @@ -874,7 +875,7 @@ lazy val zio1Json = (projectMatrix in file("json/zio1-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val tethysJson = (projectMatrix in file("json/tethys-json"))
.settings(
Expand All @@ -890,7 +891,7 @@ lazy val tethysJson = (projectMatrix in file("json/tethys-json"))
scalaVersions = scala2 ++ scala3,
settings = commonJvmSettings
)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val upickle = (projectMatrix in file("json/upickle"))
.settings(
Expand All @@ -908,7 +909,7 @@ lazy val upickle = (projectMatrix in file("json/upickle"))
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.nativePlatform(scalaVersions = scala2 ++ scala3, settings = commonNativeSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val json4sVersion = "4.0.7"

Expand All @@ -923,7 +924,7 @@ lazy val json4s = (projectMatrix in file("json/json4s"))
scalaTest
)
.jvmPlatform(scalaVersions = scala2 ++ scala3)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val sprayJson = (projectMatrix in file("json/spray-json"))
.settings(commonJvmSettings)
Expand All @@ -935,7 +936,7 @@ lazy val sprayJson = (projectMatrix in file("json/spray-json"))
scalaTest
)
.jvmPlatform(scalaVersions = scala2 ++ scala3)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val play29Json = (projectMatrix in file("json/play29-json"))
.settings(
Expand All @@ -952,7 +953,7 @@ lazy val play29Json = (projectMatrix in file("json/play29-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2, settings = commonJsSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val playJson = (projectMatrix in file("json/play-json"))
.settings(
Expand All @@ -967,14 +968,14 @@ lazy val playJson = (projectMatrix in file("json/play-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2 ++ scala3, settings = commonJsSettings)
.dependsOn(core, jsonCommon)
.dependsOn(core, jsonCommon % compileAndTest)

lazy val prometheusBackend = (projectMatrix in file("observability/prometheus-backend"))
.settings(commonJvmSettings)
.settings(
name := "prometheus-backend",
libraryDependencies ++= Seq(
"io.prometheus" % "prometheus-metrics-core" % "1.3.4"
"io.prometheus" % "prometheus-metrics-core" % "1.3.5"
),
scalaTest
)
Expand Down
10 changes: 8 additions & 2 deletions core/src/main/scala/sttp/client4/RequestOptions.scala
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package sttp.client4

import scala.concurrent.duration.Duration
import sttp.model.HttpVersion
import sttp.client4.logging.LoggingOptions

/** Options for a [[Request]]. The defaults can be found on [[emptyRequest]]. */
case class RequestOptions(
followRedirects: Boolean,
readTimeout: Duration, // TODO: Use FiniteDuration while migrating to sttp-4
readTimeout: Duration,
maxRedirects: Int,
redirectToGet: Boolean
redirectToGet: Boolean,
disableAutoDecompression: Boolean,
httpVersion: Option[HttpVersion],
loggingOptions: LoggingOptions
)
Loading

0 comments on commit 4041706

Please sign in to comment.