<@U7J0Q83AA> you can map the BodyLens, like so: ``...
# http4k
d
@ndchorley you can map the BodyLens, like so:
Copy code
import org.http4k.core.Body
import org.http4k.core.Method.GET
import org.http4k.core.Request
import org.http4k.core.body.form
import org.http4k.lens.FormField
import org.http4k.lens.Validator
import org.http4k.lens.string
import org.http4k.lens.webForm

fun main(args: Array<String>) {

    data class Student(val name: String)

    val name = FormField.string().required("name")
    val studentLens = Body.webForm(Validator.Strict, name).map { Student(name(it)) }.toLens()

    println(
        studentLens(
            Request(GET, "/")
                .header("Content-Type", "application/x-www-form-urlencoded")
                .form("name", "bob")
        )
    )
}