github zio/zio-http v2.0.0-RC3
v2.0.0-RC3 - ZIO 2 Support

latest releases: v3.0.1, v3.0.0, v3.0.0-RC10...
2 years ago

Supports ZIO v2.0.0-RC2

Highlights

  • Websocket Client Support

      val url = "ws://localhost:8090/subscriptions"
      val app = Socket
        .collect[WebSocketFrame] {
          case WebSocketFrame.Text("BAZ") => ZStream.succeed(WebSocketFrame.close(1000))
          case frame                      => ZStream.succeed(frame)
        }
        .toSocketApp
        .connect(url) // creates a socket connection on the provided URL

💥 Breaking Changes

  • Rename ClientParams to ClientRequest

      final case class ClientRequest(
        method: Method,
        url: URL,
        getHeaders: Headers = Headers.empty,
        data: HttpData = HttpData.empty,
        private val channelContext: ChannelHandlerContext = null,
      ) extends HeaderExtension[ClientRequest]
  • Drop toZIO and wrapZIO APIs

    private val app =
        Http.collectZIO[Request] {
          case Method.GET -> !! / "greet" / name  => UIO(Response.text(s"Greetings ${name}!"))
        }
  • Rename asString to encode in Scheme

    sealed trait Scheme { self =>
      def encode: String = Scheme.asString(self)
    }
  • Rename getHeaders to headers in ClientRequest

    final case class ClientRequest(
        method: Method,
        url: URL,
        headers: Headers = Headers.empty,
        data: HttpData = HttpData.empty,
        private val channelContext: ChannelHandlerContext = null,
      )
  • Remove get prefix from Public APIs

    Previous Current
    getBodyAsByteBuf bodyAsByteBuf
    getBodyAsString bodyAsString
    getBody body
    getHeaders headers
    getStatus status
    getStatus status
  • Rename asString to encode in URL

    def encode: String = ...
  • silent is removed from Http and HttpApp

Changes

🚀 Features

🐛 Bug Fixes

🧰 Maintenance

New Contributors

Full Changelog: v2.0.0-RC2...v2.0.0-RC3

Don't miss a new zio-http release

NewReleases is sending notifications on new releases.