All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.muserver.RouteHandler Maven / Gradle / Ivy

There is a newer version: 2.0.3
Show newest version
package io.muserver;

import java.util.Map;

public interface RouteHandler {

    /**
     * A handler for a Route created with {@link MuServerBuilder#addHandler(Method, String, RouteHandler)}
     * or {@link Routes#route(Method, String, RouteHandler)}
     * @param request The request
     * @param response The response
     * @param pathParams A map of path parameters, for example id would equal "123"
     *                   if the route URI template was /things/{id : [0-9]+} and the requested URI was
     *                   /things/123
     * @throws Exception Throwing an exception will result in a 500 error code being returned.
     */
    void handle(MuRequest request, MuResponse response, Map pathParams) throws Exception;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy