Releases: softwaremill/sttp
v3.0.0
sttp client v3 uses a new package name (sttp.client3
) and organization (com.softwaremill.sttp.client3
). This way old and new sttp client versions can be used side-by-side. Make sure to update your imports and build dependencies!
Documentation is updated for the new version. See also the announcement blog.
Breaking changes since v2
SttpBackend
trait
The trait now has 2, instead of 3 parameters. The "default" case of a backend with no additional capabilities changed:
SttpBackend[F, Nothing, NothingT] --> SttpBackend[F, Any]
The second type parameter now contains a list of supported additional capabilities. This can include:
- an implementation of
Streams
WebSockets
Finally, the type of supported streams is not given directly, but wrapped in a Streams
object. For example, the types of the AkkaHttpBackend
and AsyncHttpClientZioBackend
backends now are:
SttpBackend[Future, AkkaStreams with WebSockets]
SttpBackend[Task, ZioStreams with WebSockets]
Request
type
The type describing a request has undergone similar changes, with the last type parameter specifying the requirements that a backend must meet in order of the request to be sent. The "default" description of a request which doesn't use websockets or streams changed:
Request[T, Nothing] -> Request[T, Any]
Similarly, the type of ResponseAs
changed.
The Request.send()
method, which used an implicit SttpBackend
is deprecated. Instead, use Request.send(backend)
, giving the backend explicitly.
SttpBackendStub
- method name change:
thenRespondWrapped -> thenRespondF
- when nothing is stubbed, an exception (failed effect) is thrown, instead of returning 404
Other
ResponseError
->ResponseException
, but type aliases are providedResponseException
is parametrised with library-specific deserialisation exception type and http-error type. What previous wasResponseError[E]
now would beResponseException[String, E]
streamBody
sets application/octet-stream as the content type by default- the default execution context used in the akka-http backend is different: instead of
global
, the EC backing the provided actor system is used - for zio backends, the
send
method has been moved fromSttpClient
to the package (for consistency with other zio libraries) - logging backends have been combined into a single one, exposing various configuration options
WebSocket.receive*
methods return aF[T]
instead of anF[Either[WebSocketFrame.Close, T]]
. If the ws is closed, an effect failed withWebSocketClosed
will be returned (which also could have happened in the previous variant, depending on how the ws got closed). Old behaviour can be restored by wrapping the call withwebSocket.either
.Response.cookies
now returnsSeq[Either[String, CookieWithMeta]]
, as parsing cookies might fail. UseResponse.unsafeCookies
for the old exception-throwing behaviour
v3.0.0-RC15
This is a preview release, containing most of the functionality planned for sttp v3. The code passes all tests, however the API might change.
sttp client v3 uses a new package name (sttp.client3
) and organization (com.softwaremill.sttp.client3
). This way old and new sttp client versions can be used side-by-side. Make sure to update your imports and build dependencies!
Documentation is updated for the new version.
Breaking changes since v2:
SttpBackend
trait
The trait now has 2, instead of 3 parameters. The "default" case of a backend with no additional capabilities changed:
SttpBackend[F, Nothing, NothingT] --> SttpBackend[F, Any]
The second type parameter now contains a list of supported additional capabilities. This can include:
- an implementation of
Streams
WebSockets
Finally, the type of supported streams is not given directly, but wrapped in a Streams
object. For example, the types of the AkkaHttpBackend
and AsyncHttpClientZioBackend
backends now are:
SttpBackend[Future, AkkaStreams with WebSockets]
SttpBackend[Task, ZioStreams with WebSockets]
Request
type
The type describing a request has undergone similar changes, with the last type parameter specifying the requirements that a backend must meet in order of the request to be sent. The "default" description of a request which doesn't use websockets or streams changed:
Request[T, Nothing] -> Request[T, Any]
Similarly, the type of ResponseAs
changed.
The Request.send()
method, which used an implicit SttpBackend
is deprecated. Instead, use Request.send(backend)
, giving the backend explicitly.
SttpBackendStub
- method name change:
thenRespondWrapped -> thenRespondF
- when nothing is stubbed, an exception (failed effect) is thrown, instead of returning 404
Other
ResponseError
->ResponseException
, but type aliases are providedResponseException
is parametrised with library-specific deserialisation exception type and http-error type. What previous wasResponseError[E]
now would beResponseException[String, E]
streamBody
sets application/octet-stream as the content type by default- the default execution context used in the akka-http backend is different: instead of
global
, the EC backing the provided actor system is used - for zio backends, the
send
method has been moved fromSttpClient
to the package (for consistency with other zio libraries) - logging backends have been combined into a single one, exposing various configuration options
WebSocket.receive*
methods return aF[T]
instead of anF[Either[WebSocketFrame.Close, T]]
. If the ws is closed, an effect failed withWebSocketClosed
will be returned (which also could have happened in the previous variant, depending on how the ws got closed). Old behaviour can be restored by wrapping the call withwebSocket.either
.Response.cookies
now returnsSeq[Either[String, CookieWithMeta]]
, as parsing cookies might fail. UseResponse.unsafeCookies
for the old exception-throwing behaviour
v3.0.0-RC14
What’s Changed
- Update async-http-client to 2.12.2 (#799) @scala-steward
- Update akka, fs2, monix, zio to 1.0.0-RC12 (#802) @scala-steward
- Add Gitpod config, fixes #612 (#803) @nightscape
- Update http4s-blaze-client to 0.21.15 (#798) @scala-steward
- Update brave-opentracing to 1.0.0 (#793) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.14 (#797) @scala-steward
- Update sbt to 1.4.6 (#796) @scala-steward
- Update scala-collection-compat to 2.3.2 (#795) @scala-steward
- Update zipkin-sender-okhttp3 to 2.16.3 (#794) @scala-steward
- Update finagle-http to 20.12.0 (#791) @scala-steward
- Update scribe to 3.1.8 (#790) @scala-steward
- Update akka-http to 10.2.2 (#792) @scala-steward
- Add support for server sent events via response asStream (#781) @adamsmo
- Logging backend improvements: customisable log levels (#786) @adamw
- Closes #782: properly detecting relative requests (#785) @adamw
- Add methods which allow defining stream/websocket handling behavior taking into account the response metadata (#784) @adamw
- Fix test flakiness by reducing test parallelism (#777) @adamsmo
- Revert "Update http4s-blaze-client to 0.21.13" (#778) @adamw
- Update scribe to 3.1.3 (#775) @scala-steward
- Update http4s-blaze-client to 0.21.13 (#772) @scala-steward
- Update scala-collection-compat to 2.3.1 (#768) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.13 (#770) @scala-steward
- HttpClientBackend: fixed binary subparts' headers of a multipart request (#776) @pinguinson
- Update scribe to 3.1.2 (#774) @scala-steward
- Remove travis, use gh actions (#766) @adamw
- Update http4s-blaze-client to 0.21.11 (#761) @scala-steward
- Update sbt to 1.4.4 (#764) @scala-steward
- Don't explicitly set Content-Type on multipart/form-data requests (#763) @sbrunk
- Update zipkin-sender-okhttp3 to 2.16.1 (#765) @scala-steward
- Update jaeger-client to 1.5.0 (#755) @scala-steward
- Update scala-collection-compat to 2.3.0 (#762) @scala-steward
- Update brave-opentracing to 0.37.5 (#760) @scala-steward
- Update sbt to 1.4.3 (#759) @scala-steward
- Update sbt-scalajs, scalajs-compiler, ... to 1.3.1 (#758) @scala-steward
- Update spray-json to 1.3.6 (#756) @scala-steward
- Update scribe to 3.0.4 (#754) @scala-steward
- Update sbt-dotty to 0.4.6 (#753) @scala-steward
- Update zipkin-sender-okhttp3 to 2.16.0 (#750) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.12 (#751) @scala-steward
- Update brave-opentracing to 0.37.4 (#749) @scala-steward
- Update scribe to 3.0.3 (#748) @scala-steward
v3.0.0-RC13
What’s Changed
- Add support for server sent events via response asStream (#781) @adamsmo
- Logging backend improvements: customisable log levels (#786) @adamw
- Closes #782: properly detecting relative requests (#785) @adamw
- Add methods which allow defining stream/websocket handling behavior taking into account the response metadata (#784) @adamw
- Fix test flakiness by reducing test parallelism (#777) @adamsmo
- Revert "Update http4s-blaze-client to 0.21.13" (#778) @adamw
- Update scribe to 3.1.3 (#775) @scala-steward
- Update http4s-blaze-client to 0.21.13 (#772) @scala-steward
- Update scala-collection-compat to 2.3.1 (#768) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.13 (#770) @scala-steward
- HttpClientBackend: fixed binary subparts' headers of a multipart request (#776) @pinguinson
- Update scribe to 3.1.2 (#774) @scala-steward
- Remove travis, use gh actions (#766) @adamw
- Update http4s-blaze-client to 0.21.11 (#761) @scala-steward
- Update sbt to 1.4.4 (#764) @scala-steward
- Don't explicitly set Content-Type on multipart/form-data requests (#763) @sbrunk
- Update zipkin-sender-okhttp3 to 2.16.1 (#765) @scala-steward
- Update jaeger-client to 1.5.0 (#755) @scala-steward
- Update scala-collection-compat to 2.3.0 (#762) @scala-steward
- Update brave-opentracing to 0.37.5 (#760) @scala-steward
- Update sbt to 1.4.3 (#759) @scala-steward
- Update sbt-scalajs, scalajs-compiler, ... to 1.3.1 (#758) @scala-steward
- Update spray-json to 1.3.6 (#756) @scala-steward
- Update scribe to 3.0.4 (#754) @scala-steward
- Update sbt-dotty to 0.4.6 (#753) @scala-steward
- Update zipkin-sender-okhttp3 to 2.16.0 (#750) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.12 (#751) @scala-steward
- Update brave-opentracing to 0.37.4 (#749) @scala-steward
- Update scribe to 3.0.3 (#748) @scala-steward
v3.0.0-RC11
What’s Changed
- Revert "Update http4s-blaze-client to 0.21.13" (#778) @adamw
- Update scribe to 3.1.3 (#775) @scala-steward
- Update http4s-blaze-client to 0.21.13 (#772) @scala-steward
- Update scala-collection-compat to 2.3.1 (#768) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.13 (#770) @scala-steward
- HttpClientBackend: fixed binary subparts' headers of a multipart request (#776) @pinguinson
- Update scribe to 3.1.2 (#774) @scala-steward
- Remove travis, use gh actions (#766) @adamw
- Update http4s-blaze-client to 0.21.11 (#761) @scala-steward
- Update sbt to 1.4.4 (#764) @scala-steward
- Don't explicitly set Content-Type on multipart/form-data requests (#763) @sbrunk
- Update zipkin-sender-okhttp3 to 2.16.1 (#765) @scala-steward
- Update jaeger-client to 1.5.0 (#755) @scala-steward
- Update scala-collection-compat to 2.3.0 (#762) @scala-steward
- Update brave-opentracing to 0.37.5 (#760) @scala-steward
- Update sbt to 1.4.3 (#759) @scala-steward
- Update sbt-scalajs, scalajs-compiler, ... to 1.3.1 (#758) @scala-steward
- Update spray-json to 1.3.6 (#756) @scala-steward
- Update scribe to 3.0.4 (#754) @scala-steward
- Update sbt-dotty to 0.4.6 (#753) @scala-steward
- Update zipkin-sender-okhttp3 to 2.16.0 (#750) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.12 (#751) @scala-steward
- Update brave-opentracing to 0.37.4 (#749) @scala-steward
- Update scribe to 3.0.3 (#748) @scala-steward
v3.0.0-RC10
What’s Changed
- Remove travis, use gh actions (#766) @adamw
- Update http4s-blaze-client to 0.21.11 (#761) @scala-steward
- Update sbt to 1.4.4 (#764) @scala-steward
- Don't explicitly set Content-Type on multipart/form-data requests (#763) @sbrunk
- Update zipkin-sender-okhttp3 to 2.16.1 (#765) @scala-steward
- Update jaeger-client to 1.5.0 (#755) @scala-steward
- Update scala-collection-compat to 2.3.0 (#762) @scala-steward
- Update brave-opentracing to 0.37.5 (#760) @scala-steward
- Update sbt to 1.4.3 (#759) @scala-steward
- Update sbt-scalajs, scalajs-compiler, ... to 1.3.1 (#758) @scala-steward
- Update spray-json to 1.3.6 (#756) @scala-steward
- Update scribe to 3.0.4 (#754) @scala-steward
- Update sbt-dotty to 0.4.6 (#753) @scala-steward
- Update zipkin-sender-okhttp3 to 2.16.0 (#750) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.12 (#751) @scala-steward
- Update brave-opentracing to 0.37.4 (#749) @scala-steward
- Update scribe to 3.0.3 (#748) @scala-steward
v3.0.0-RC9
What’s Changed
- Update sttp-shared, switch to new monix binary streams representation (#747) @adamw
- Fix handling of host header in finagle-backend (#746) @sloanesturz
- Non blocking monix http (#745) @ghostbuster91
v3.0.0-RC8
What’s Changed
- Add upickle module (#740) @lolgab
- Update scribe to 3.0.0 (#744) @scala-steward
- Update zipkin-sender-okhttp3 to 2.15.4 (#743) @scala-steward
- Update sbt-dotty to 0.4.5 (#739) @scala-steward
- Update sbt to 1.4.2 (#742) @scala-steward
- Update zipkin-sender-okhttp3 to 2.15.3 (#741) @scala-steward
- Update finagle-http to 20.10.0 (#736) @scala-steward
v3.0.0-RC7
v3.0.0-RC6
What’s Changed
- Update akka-http to 10.2.1 (#731) @scala-steward
- Update scribe to 2.8.6 (#733) @scala-steward
- Update akka-stream to 2.6.10 (#729) @scala-steward
- Update scribe to 2.7.13 (#728) @scala-steward
- Publish playJson module for ScalaJs (#709) @dpfeiffer
- Update sbt-scalajs, scalajs-compiler to 1.3.0 (#717) @scala-steward
- Update sbt-ide-settings to 1.1.0 (#715) @scala-steward
- Update resilience4j-circuitbreaker, ... to 1.6.1 (#714) @scala-steward
- Update sbt to 1.4.1 (#725) @scala-steward
- Remove obsolete steps for testing scala JS backend (#724) @ghostbuster91
- Update sbt-dotty to 0.4.4 (#723) @scala-steward
- Update sbt-mdoc to 2.2.10 (#722) @scala-steward
- Update scalafmt-core to 2.7.5 (#721) @scala-steward
- Update http4s-blaze-client to 0.21.8 (#718) @scala-steward
- Update scalafmt-core to 2.7.4 (#711) @scala-steward
- Update scalafmt-core to 2.7.3 (#707) @scala-steward