water.api
Class RequestServer
java.lang.Object
water.NanoHTTPD
water.api.RequestServer
public class RequestServer
- extends NanoHTTPD
This is a simple web server.
Field Summary |
protected static java.util.HashMap<java.lang.String,Request> |
_requests
|
Fields inherited from class water.NanoHTTPD |
HTTP_BADREQUEST, HTTP_FORBIDDEN, HTTP_INTERNALERROR, HTTP_NOTFOUND, HTTP_NOTIMPLEMENTED, HTTP_NOTMODIFIED, HTTP_OK, HTTP_PARTIALCONTENT, HTTP_RANGE_NOT_SATISFIABLE, HTTP_REDIRECT, HTTP_TOOLONGREQUEST, HTTP_UNAUTHORIZED, MIME_DEFAULT_BINARY, MIME_HTML, MIME_JSON, MIME_PLAINTEXT, MIME_XML, myOut |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_requests
protected static final java.util.HashMap<java.lang.String,Request> _requests
requests
public static java.util.HashMap<java.lang.String,Request> requests()
registerRequest
public static Request registerRequest(Request req)
- Registers the request with the request server.
unregisterRequest
public static void unregisterRequest(Request req)
start
public static void start()
serve
public NanoHTTPD.Response serve(java.lang.String uri,
java.lang.String method,
java.util.Properties header,
java.util.Properties parms)
- Description copied from class:
NanoHTTPD
- Override this to customize the server.
(By default, this delegates to serveFile() and allows directory listing.)
- Overrides:
serve
in class NanoHTTPD
- Parameters:
uri
- Percent-decoded URI without parameters, for example "/index.cgi"method
- "GET", "POST" etc.header
- Header entries, percent decodedparms
- Parsed, percent decoded parameters from URI and, in case of POST, data.
- Returns:
- HTTP response, see class Response for details