Class HTTPServer.DefaultHandler
java.lang.Object
ch.autumo.beetroot.server.HTTPServer.DefaultStreamHandler
ch.autumo.beetroot.server.HTTPServer.DefaultHandler
- All Implemented Interfaces:
HTTPServer.UriResponder
- Direct Known Subclasses:
BaseHandler, HTTPServer.Error404UriHandler, HTTPServer.GeneralHandler, HTTPServer.IndexHandler, HTTPServer.NotImplementedHandler, HTTPServer.StaticPageHandler
- Enclosing class:
HTTPServer
General nanolet to inherit from if you provide text or html data, only
fixed size responses will be generated.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.nanohttpd.protocols.http.response.Responseget(HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Handles an HTTP GET request.getData()Get data input stream.abstract org.nanohttpd.protocols.http.response.IStatusHTTP status of the response.abstract StringgetText()Text or HTML content returned by this handler.Methods inherited from class HTTPServer.DefaultStreamHandler
delete, getMimeType, other, post, putModifier and TypeMethodDescriptionorg.nanohttpd.protocols.http.response.Responsedelete(HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Handles an HTTP DELETE request.abstract StringMIME type of the streamed data.org.nanohttpd.protocols.http.response.Responseother(String method, HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Handles any other HTTP method.org.nanohttpd.protocols.http.response.Responsepost(HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Handles an HTTP POST request.org.nanohttpd.protocols.http.response.Responseput(HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Handles an HTTP PUT request.
-
Constructor Details
-
DefaultHandler
public DefaultHandler()Default constructor.
-
-
Method Details
-
getText
Text or HTML content returned by this handler.- Returns:
- the response body
-
getStatus
public abstract org.nanohttpd.protocols.http.response.IStatus getStatus()HTTP status of the response.- Specified by:
getStatusin classHTTPServer.DefaultStreamHandler- Returns:
- the response status
-
get
public org.nanohttpd.protocols.http.response.Response get(HTTPServer.UriResource uriResource, Map<String, String> urlParams, org.nanohttpd.protocols.http.IHTTPSession session) Description copied from interface:HTTPServer.UriResponderHandles an HTTP GET request.- Specified by:
getin interfaceHTTPServer.UriResponder- Overrides:
getin classHTTPServer.DefaultStreamHandler- Parameters:
uriResource- the route that matched the requesturlParams- the parameters extracted from the URIsession- the HTTP session- Returns:
- the response
-
getData
Description copied from class:HTTPServer.DefaultStreamHandlerGet data input stream.- Specified by:
getDatain classHTTPServer.DefaultStreamHandler- Returns:
- data input stream
-