Releases: softwaremill/sttp
v3.1.9
What’s Changed
- Update scalatest-flatspec, ... to 3.2.6 (#890) @scala-steward
- Update scalatest-freespec to 3.2.6 (#891) @scala-steward
- Update zio, zio-streams to 1.0.5 (#893) @scala-steward
- Update upickle to 1.3.4 (#896) @scala-steward
- Update scribe to 3.5.0 (#888) @scala-steward
- zio-json support (#882) @svroonland
- Update model:core to 1.3.4 (#895) @scala-steward
- Update sbt to 1.4.9 (#894) @scala-steward
- Update sbt to 1.4.8 (#889) @scala-steward
- remove stack trace from expected exception (#887) @yanns
v3.1.7
What’s Changed
- web sockets support in JS backends (#880) @kubinio123
- Update http4s-blaze-client, http4s-client to 0.21.20 (#886) @scala-steward
- Update json4s-core, json4s-native to 3.6.11 (#885) @scala-steward
- Update scala-compiler, scala-library to 2.13.5 (#883) @scala-steward
- Simplify sbt (#881) @adamw
- Update scribe to 3.4.0 (#879) @scala-steward
- Update akka-http to 10.2.4 (#878) @scala-steward
v3.1.6
What’s Changed
- add charset to content-type headers in multipart body (#877) @dkarwacki
- Update akka-stream to 2.6.13 (#876) @scala-steward
- Configure read timeout correctly for Armeria backend (#875) @ikhoon
- Update websockets.md with websocket compression description. (#874) @leedgdev
v3.1.5
What’s Changed
- Enable scala 3 for cats and fs2 backends (#871) @aeons
- Update shared:akka, shared:core, shared:fs2, ... to 1.1.1 (#870) @scala-steward
- Update scalatest-freespec, ... to 3.2.5 (#868) @scala-steward
- Update scalatest-flatspec, ... to 3.2.5 (#867) @scala-steward
- Update mdoc_2.13, sbt-mdoc to 2.2.18 (#865) @scala-steward
- SSL example for HttpUrlConnection (#861) @kubinio123
- Support Streaming for Armeria backend (#860) @ikhoon
v3.1.3
What’s Changed
- updated FetchBackend docs for Node.js (#866) @kubinio123
- Update scala-collection-compat to 2.4.2 (#863) @scala-steward
- updated docs with info about supporting host headers overrides (#857) @kubinio123
- Update sbt-dotty to 0.5.3 (#862) @scala-steward
v3.1.2
What’s Changed
- Update http4s-blaze-client, http4s-client to 0.21.19 (#859) @scala-steward
- Update sbt-scalajs, scalajs-compiler, ... to 1.5.0 (#856) @scala-steward
- Update armeria to 1.5.0 (#858) @scala-steward
- Update finagle-http to 21.2.0 (#855) @scala-steward
v3.1.1
What’s Changed
- Issue/619 (#853) @kubinio123
- Update mdoc_2.13, sbt-mdoc to 2.2.17 (#852) @scala-steward
- Update scribe to 3.3.3 (#854) @scala-steward
- Update okhttp to 4.9.1 (#840) @scala-steward
- Update model:core to 1.3.3 (#848) @scala-steward
- Update scribe to 3.3.2 (#850) @scala-steward
- Update http4s-blaze-client, http4s-client to 0.21.18 (#847) @scala-steward
- Update sbt to 1.4.7 (#842) @scala-steward
- Update zio, zio-streams to 1.0.4-2 (#846) @scala-steward
- Update http4s-blaze-client, http4s-client to 0.21.17 (#845) @scala-steward
- Update zio, zio-streams to 1.0.4-1 (#844) @scala-steward
- Update scala-collection-compat to 2.4.1 (#841) @scala-steward
- Update zio-opentracing to 0.7.2 (#839) @scala-steward
- Update akka-stream to 2.6.12 (#838) @scala-steward
v3.1.0
What’s Changed
- Update sbt-scala-native to 0.4.0 (#817) @scala-steward
- Update simpleclient to 0.10.0 (#828) @scala-steward
- Update upickle to 1.2.3 (#835) @scala-steward
- Update scribe to 3.3.1 (#837) @scala-steward
- Update scalaz-concurrent to 7.2.31 (#822) @scala-steward
- Implement cats-js backend using fetch (#834) @adamw
- Update scribe to 3.2.5 (#833) @scala-steward
- Update scala-collection-compat to 2.4.0 (#832) @scala-steward
- Update model:core to 1.2.2 (#831) @scala-steward
- Update sbt-dotty to 0.5.2 (#830) @scala-steward
- Update model:core to 1.2.1 (#829) @scala-steward
- Update resilience4j-circuitbreaker, ... to 1.7.0 (#827) @scala-steward
- Update http4s-blaze-client, http4s-client to 0.21.16 (#826) @scala-steward
- Update zio-opentracing to 0.7.1 (#825) @scala-steward
- Update scribe to 3.2.4 (#824) @scala-steward
- Update zio, zio-streams to 1.0.4 (#823) @scala-steward
- Update scribe to 3.2.3 (#820) @scala-steward
- Update mdoc, sbt-mdoc to 2.2.16 (#818) @scala-steward
- Update finagle-http to 21.1.0 (#812) @scala-steward
- Update akka-http to 10.2.3 (#815) @scala-steward
- Update scribe to 3.2.1 (#811) @scala-steward
- Update akka-stream to 2.6.11 (#810) @scala-steward
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