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

fordream.http.RequestHandler Maven / Gradle / Ivy

There is a newer version: 1.0.2
Show newest version
package fordream.http;

import java.util.Map;

import static fi.iki.elonen.NanoHTTPD.IHTTPSession;
import static fi.iki.elonen.NanoHTTPD.Response;

public interface RequestHandler {
    public static final String MIME_JSON = "application/json";
    public static final String MIME_XML = "application/xml";

    /**
     * @param args the params of the request
     * @param uri  the uri of the request
     * @return return true, if this handler handle the request.
     */
    boolean doHandler(Map args, String uri);

    /**
     * handle the request
     *
     * @param root    the url of the HTTP server's root
     * @param args    the params of the request
     * @param session information of the session
     * @return the response to return to client.
     */
    Response onRequest(String root, Map args, IHTTPSession session);
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy