sttp v3.0.0-RC2 Release Notes

Release Date: 2020-09-10 // over 3 years ago
  • ๐Ÿš€ This is a preview release, containing most of the functionality planned for sttp v3. The code passes all tests, however the API might change.

    ๐Ÿ’ฅ Breaking changes since v2:

    SttpBackend trait

    0๏ธโƒฃ 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

    0๏ธโƒฃ 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 provided
    • ๐Ÿ‘€ ResponseException is parametrised with library-specific deserialisation exception type and http-error type. What previous was ResponseError[E] now would be ResponseException[String, E]
    • 0๏ธโƒฃ streamBody sets application/octet-stream as the content type by default
    • 0๏ธโƒฃ 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 from SttpClient to the package (for consistency with other zio libraries)
    • ๐Ÿ”ง logging backends have been combined into a single one, exposing various configuration options