public abstract class AbstractHTTPD extends NanoHTTPD implements HTTPGetHandler
NanoHTTPD
to (a) prevent serving files from
the local file system; and (b) to expose methods for handling GET, PUT, POST,
and DELETE requests - these methods all return a
NanoHTTPD.HTTP_METHOD_NOT_ALLOWED
NanoHTTPD.Response
by default.NanoHTTPD.Request, NanoHTTPD.Response
IServiceShutdown.Options
CONTENT_LENGTH, CONTENT_TYPE, DATE, DELETE, ERR_BAD_REQUEST, GET, HTTP_BADREQUEST, HTTP_FORBIDDEN, HTTP_INTERNALERROR, HTTP_METHOD_NOT_ALLOWED, HTTP_NOTFOUND, HTTP_NOTIMPLEMENTED, HTTP_OK, HTTP_REDIRECT, httpDefaultCharacterEncoding, MIME_APPLICATION_URL_ENCODED, MIME_APPLICATION_XML, MIME_DEFAULT_BINARY, MIME_TEXT_HTML, MIME_TEXT_JAVASCRIPT, MIME_TEXT_PLAIN, POST, PUT, UTF8
Constructor and Description |
---|
AbstractHTTPD(int port) |
Modifier and Type | Method and Description |
---|---|
NanoHTTPD.Response |
doDelete(NanoHTTPD.Request req)
Handle a DELETE request.
|
NanoHTTPD.Response |
doGet(NanoHTTPD.Request req)
Handle a GET request.
|
NanoHTTPD.Response |
doPost(NanoHTTPD.Request req)
Handle a POST request.
|
NanoHTTPD.Response |
doPut(NanoHTTPD.Request req)
Handle a PUT request.
|
NanoHTTPD.Response |
serve(NanoHTTPD.Request req)
Override this to customize the server.
|
decodeParams, encodeParams, getPort, isOpen, main, serveFile, shutdown, shutdownNow
public AbstractHTTPD(int port) throws IOException
IOException
public NanoHTTPD.Response serve(NanoHTTPD.Request req)
NanoHTTPD
public NanoHTTPD.Response doGet(NanoHTTPD.Request req) throws Exception
doGet
in interface HTTPGetHandler
req
- The requestException
NanoHTTPD.Response
public NanoHTTPD.Response doPost(NanoHTTPD.Request req) throws Exception
req
- The requestException
public NanoHTTPD.Response doPut(NanoHTTPD.Request req) throws Exception
req
- The requestException
public NanoHTTPD.Response doDelete(NanoHTTPD.Request req) throws Exception
req
- The requestException
Copyright © 2006–2019 SYSTAP, LLC DBA Blazegraph. All rights reserved.