Skip to content

V2 Request and Response Bodies

Lukas Ruegner edited this page Jun 2, 2024 · 2 revisions

Information about request and response bodies can be added in the respective blocks.

get("hello", {
    request {
        body<String>() {
            // document request body
        }
    }
    response {
        HttpStatusCode.OK to {
            body<String>() {
                // document response body for "OK"
            }
        }
        HttpStatusCode.NotFound to {
            body<String>() {
                // document response body for "Not Found"
            }
        }
    }
}) {
    // handle request...
}

More Information:

Clone this wiki locally