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 LinkedHashMap<String,Method> |
_handlers |
protected static HashMap<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 String |
maybeTransformRequest(String uri) |
static String |
registerDELETE(String url,
Class hclass,
String hmeth) |
static String |
registerGET(String url,
Class hclass,
String hmeth)
Registers the request with the request server.
|
static String |
registerPOST(String url,
Class hclass,
String hmeth) |
static String |
registerPUT(String url,
Class hclass,
String hmeth) |
static Request |
registerRequest(Request req)
Registers the request with the request server.
|
static NanoHTTPD.Response |
response404(NanoHTTPD server,
Properties parms) |
static NanoHTTPD.Response |
response500(NanoHTTPD server,
Properties parms) |
NanoHTTPD.Response |
serve(String uri,
String method,
Properties header,
Properties parms)
Override this to customize the server.
|
static void |
start() |
static void |
unregisterRequest(Request req) |
protected static final LinkedHashMap<String,Method> _handlers
public static final NanoHTTPD.Response response404(NanoHTTPD server, Properties parms)
public static final NanoHTTPD.Response response500(NanoHTTPD server, Properties parms)
public static Request registerRequest(Request req)
public static void unregisterRequest(Request req)
public static String registerGET(String url, Class hclass, String hmeth)
public static void start()
public NanoHTTPD.Response serve(String uri, String method, Properties header, Properties parms)
NanoHTTPD(By default, this delegates to serveFile() and allows directory listing.)
serve in class NanoHTTPDuri - 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.Copyright © 2013–2014 0xdata. All rights reserved.