class Main {

    public void readContentEntity() {
        Routing routing = Routing.builder()
                                 .post("/foo", (req, res) -> {
                                     req.content()
                                        .as(String.class)
                                        // The whole entity can be read when all request chunks are processed - CompletionStage
                                        .whenComplete((data, thr) -> {
                                            if (thr == null) {
                                                System.out.println("/foo DATA: " + data);
                                                res.send(data);
                                            } else {
                                                res.status(Http.Status.BAD_REQUEST_400);
                                            }
                                        });
                                 })
                                 // It is possible to use Hanlder.of() method to automatically cover all error states.
                                 .post("/bar", Handler.create(String.class, (req, res, data) -> {
                                     System.out.println("/foo DATA: " + data);
                                     res.send(data);
                                 }))
                                 .build();
        startServer(routing);
    }

}