272 namespace RestHandler {
286 abstract string name();
345 "body":
"not implemented",
359 "serialize": \makeJSONString(),
360 "deserialize": \parseJSON(),
363 "serialize": \makeYAML(),
364 "deserialize": \parseYAML(),
368 "serialize": \makeYAML(),
369 "deserialize": \parseYAML(),
372 "serialize": \makeXMLRPCValueString(),
373 "deserialize": \parseXMLRPCValue(),
456 static hash makeResponse(
int code, any body, *
hash hdr);
constructor(*AbstractAuthenticator auth)
create the object optionally with the given AbstractAuthenticator
logDebug(string fmt)
default implementation is empty; this method is called with debug log messages; reimplement in subcla...
const Err501
a hash for a 501 Unimplemented error message
Definition: RestHandler.qm.dox.h:343
logInfo(string fmt)
default implementation is empty; this method is called with informational log messages; reimplement i...
const MimeDataTypes
supported mime types for de/serializing responses
Definition: RestHandler.qm.dox.h:357
removeRootPath(reference path)
default implementation is empty
responseSerializationError(hash cx, *hash aih, hash rv)
default implementation is empty
logError(string fmt)
default implementation is empty; this method is called with error log messages; reimplement in subcla...
RestHandler::RestHandler ch
class hash: name -> AbstractRestClass
addClass(AbstractRestClass cls)
adds a REST class to the handler
hash unknownSubClassError(string name)
throws a "REST-CLASS-ERROR" exception when a request tries to access an unknown subclass ...
string name()
returns the name of the root REST class
*AbstractRestClass subClass(string name, hash cx, *hash args)
this method will be called to find a sub-class (ie with GET /invoices/1 - if this class represents "...
hash handleRequest(RestHandler rh, *list cl, string mn, hash cx, *hash args)
this method is called by the RestHandler class to match the right object with incoming requests ...
the base abstract class for REST handler classes
Definition: RestHandler.qm.dox.h:275
requestDeserializationError(hash hdr, hash cx, string body)
default implementation is empty
const Methods
supported HTTP methods
Definition: RestHandler.qm.dox.h:349
hash dispatch(RestHandler rh, *string oname, string mn, *hash ah, hash cx)
this method is called to dispatch requests on the given object
abstract string name()
this provides the name of the REST class
hash handleRequest(hash cx, hash hdr, *data b)
called by the HTTP server to handle incoming HTTP requests
this is the main handler class to be registered with the HttpServer
Definition: RestHandler.qm.dox.h:338