Is there any built-in way to perform body lens con...
# http4k
a
Is there any built-in way to perform body lens content negotiation in http4k? I.e. something vaguely like:
Copy code
val jsonBodyLens = ...
val xmlBodyLens = ...
val contentNegotiated = ContentNegotiated.lens(jsonBodyLens, xmlBodyLens)

fun handler(request: Request): Response {
  val accept = Header.ACCEPT(request)
  val effectiveLens = contentNegotiated(accept)
  val content = MyDto(1, "stuff")
  return Response(Status.OK).with(effectiveLens of content)
}
If not, want one?