public class RequestServer extends NanoHTTPD
Modifier and Type | Class and Description |
---|---|
static class |
RequestServer.API_VERSION |
NanoHTTPD.Response
Modifier and Type | Field and Description |
---|---|
protected static java.util.HashMap<java.lang.String,Request> |
_requests |
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
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
maybeTransformRequest(java.lang.String uri) |
static Request |
registerRequest(Request req)
Registers the request with the request server.
|
NanoHTTPD.Response |
serve(java.lang.String uri,
java.lang.String method,
java.util.Properties header,
java.util.Properties parms)
Override this to customize the server.
|
static void |
start() |
static void |
unregisterRequest(Request req) |
protected static final java.util.HashMap<java.lang.String,Request> _requests
public static Request registerRequest(Request req)
public static void unregisterRequest(Request req)
public static void start()
public static java.lang.String maybeTransformRequest(java.lang.String uri)
public NanoHTTPD.Response serve(java.lang.String uri, java.lang.String method, java.util.Properties header, java.util.Properties parms)
NanoHTTPD
(By default, this delegates to serveFile() and allows directory listing.)
serve
in class NanoHTTPD
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.