Qore RestHandler Module Reference  0.1
 All Classes Namespaces Functions Variables Groups Pages
RestHandler::RestHandler Class Reference

this is the main handler class to be registered with the HttpServer More...

Inheritance diagram for RestHandler::RestHandler:

Public Attributes

const Err501
 a hash for a 501 Unimplemented error message
 
const Methods
 supported HTTP methods
 
const MimeDataTypes
 supported mime types for de/serializing responses
 

Additional Inherited Members

- Public Member Functions inherited from RestHandler::AbstractRestClass
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
 
abstract string name ()
 this provides the name of the 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 "invoices", then subClass("1") will be called to return invoice 1; return NOTHING if the object doesn't exist More...
 

Detailed Description

this is the main handler class to be registered with the HttpServer

The RestHandler class should be subclassed to customize its behavior.

To provide for logging; the following methods can be reimplemented in subclasses:

  • RestHandler::RestHandler::logInfo()
  • RestHandler::RestHandler::logError()
  • RestHandler::RestHandler::logDebug()

In order to match REST requests under a root path, reimplement the following method in a subclass:

  • RestHandler::RestHandler::removeRootPath()