fordream.http.RequestHandler Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of httpd Show documentation
Show all versions of httpd Show documentation
A Simple HTTP service based on NanoHTTPD.
The 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);
}