zio-http icon indicating copy to clipboard operation
zio-http copied to clipboard

Decode response body to case class

Open vasiliybondarenko opened this issue 2 years ago • 0 comments

It would be nice to have the following code works:

  val env = ChannelFactory.auto ++ EventLoopGroup.auto()
  val url = "http://sports.api.decathlon.com/groups/water-aerobics"

  val program = for {
    res  <- Client.request(url)
    data <- res.bodyAs[MyCaseClass]
    _    <- Console.printLine(data)
  } yield ()

vasiliybondarenko avatar Jul 29 '22 08:07 vasiliybondarenko