308 namespace RestHandler {
419 abstract string name();
476 "body":
"not implemented",
485 "OPTIONS":
"options",
489 const MimeDataTypes = (
491 "serialize": \makeJSONString(),
492 "deserialize": \parseJSON(),
495 "serialize": \makeYAML(),
496 "deserialize": \parseYAML(),
500 "serialize": \makeYAML(),
501 "deserialize": \parseYAML(),
504 "serialize": \makeXMLRPCValueString(),
505 "deserialize": \parseXMLRPCValue(),
508 "serialize":
string (any $body) {
return sprintf(
"<pre>%N</pre>", $body); },
526 constructor(*AbstractAuthenticator auth);
556 hash handleRequest(HttpListener listener, Socket s,
hash cx,
hash hdr, *data b);
560 removeRootPath(reference path);
564 requestDeserializationError(
hash hdr,
hash cx,
string body);
568 responseSerializationError(
hash cx, *
hash aih,
hash rv);
576 logError(
string fmt);
580 logDebug(
string fmt);
588 static hash makeResponse(
int code, any body, *
hash hdr);
string sprintf(string fmt,...)
hash ch
class hash: name -> AbstractRestClass
Definition: RestHandler.qm.dox.h:516
constructor(hash cx, *hash ah)
creates the object with the given arguments
AbstractHttpRequestHandler handler
private nothing recvImpl(hash v)
callback method for receiving chunked data; this calls RestHandler::AbstractRestStreamRequestHandler:...
hash handleRequest(HttpListener listener, RestHandler rh, Socket s, *list cl, string mn, hash cx, *hash args)
this method is called by the RestHandler class to match the right object with incoming requests ...
*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 "...
the base abstract class for REST stream request handlers
Definition: RestHandler.qm.dox.h:311
the base abstract class for REST handler classes
Definition: RestHandler.qm.dox.h:408
private hash getResponseHeaderMessageImpl()
the base class for handling HTTP chunked requests and responses within the RestHandler infrastructure...
Definition: RestHandler.qm.dox.h:359
hash getResponseHeaderMessage()
this method returns the response message description hash by calling getResponseHeaderMessageImpl() ...
private any sendImpl()
callback method for sending chunked data; this calls RestHandler::AbstractRestStreamRequestHandler::s...
abstract string name()
this provides the name of the REST class
private hash dispatchStream(HttpListener listener, RestHandler rh, Socket s, string mn, *hash ah, hash cx)
this method is called to dispatch streamed requests on the given object
private hash unknownSubClassError(string name)
throws a "REST-CLASS-ERROR" exception when a request tries to access an unknown subclass ...
private hash dispatch(RestHandler rh, string mn, *hash ah, hash cx)
this method is called to dispatch requests on the given object
hash rhdr
headers to add in the response
Definition: RestHandler.qm.dox.h:323
this is the main handler class to be registered with the HttpServer
Definition: RestHandler.qm.dox.h:469
constructor(RestHandler::AbstractRestStreamRequestHandler rsh, HttpListener listener, AbstractHttpRequestHandler handler, Socket s, hash cx, hash hdr, any body)
creates the object with the given attributes
hash ah
call argument hash
Definition: RestHandler.qm.dox.h:320