zio-http
zio-http copied to clipboard
Decode response body to case class
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 ()