Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface HttpHandler
Functional interface for handling HTTP requests.

This is the main abstraction for implementing HTTP endpoints in the SDK. It follows a simple request-in/response-out pattern, completely decoupled from any specific HTTP server implementation (Jetty, Netty, etc.).

Example usage:


 KokosHandler handler = request -> {
     String name = request.queryParam("name");
     return HttpResponse.ok("{\"hello\":\"" + name + "\"}");
 };
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    handle(HttpRequest request, HttpResponse response)
    Processes an HTTP request and returns an HTTP response.
  • Method Details