519 abstract string name();
576 "body":
"not implemented",
585 "OPTIONS":
"options",
589 const MimeDataTypes = (
591 "serialize": \make_json(),
592 "deserialize": \parse_json(),
595 "serialize": \make_yaml(),
596 "deserialize": \parse_yaml(),
600 "serialize": \make_yaml(),
601 "deserialize": \parse_yaml(),
604 "serialize": \make_xmlrpc_value(),
605 "deserialize": \parse_xmlrpc_value(),
608 "serialize":
string (any body) {
return sprintf(
"<pre>%N</pre>", body); },
656 hash handleRequest(HttpListenerInterface listener, Socket s,
hash cx,
hash hdr, *data b);
660 removeRootPath(reference path);
664 requestDeserializationError(
hash hdr,
hash cx,
string body);
668 responseSerializationError(
hash cx, *
hash aih,
hash rv);
676 logError(
string fmt);
680 logDebug(
string fmt);
692 static hash makeResponse(
int code, any body, *
hash hdr);
string sprintf(string fmt,...)
hash ch
class hash: name -> AbstractRestClass
Definition: RestHandler.qm.dox.h:616
*int getTimeout()
returns the timeout in milliseconds or NOTHING if no timeout is set
streamError(hash n_ex)
registers stream errors in the send operation with the stream handler if no error is already present ...
hash cx
call context hash
Definition: RestHandler.qm.dox.h:335
the RestHandler namespace contains all the objects in the RestHandler module
Definition: RestHandler.qm.dox.h:317
AbstractHttpRequestHandler handler
destructor()
destroys the object and updates the request handler about the status of the persistent connection ...
abstract any sendImpl()
abstract callback method for sending chunked data
private nothing recvImpl(hash v)
callback method for receiving chunked data; this calls RestHandler::AbstractRestStreamRequestHandler:...
nothing recv(hash v)
this method provides the callback method for receiving chunked data by calling recvImpl() ...
*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 "i...
*hash ah
call argument hash
Definition: RestHandler.qm.dox.h:341
the base abstract class for REST stream request handlers
Definition: RestHandler.qm.dox.h:326
HttpListenerInterface listener
constructor(RestHandler::AbstractRestStreamRequestHandler n_stream, HttpServer::HttpListenerInterface listener, HttpServer::AbstractHttpRequestHandler handler, Socket s, hash cx, hash hdr, any body)
creates the object with the given attributes
the base abstract class for REST handler classes
Definition: RestHandler.qm.dox.h:508
private hash getResponseHeaderMessageImpl()
the base class for handling HTTP chunked requests and responses within the RestHandler infrastructure...
Definition: RestHandler.qm.dox.h:455
*int timeout_ms
socket I/O timeout in milliseconds
Definition: RestHandler.qm.dox.h:347
hash getResponseHeaderMessage()
this method returns the response message description hash by calling getResponseHeaderMessageImpl() ...
*code getPersistentClosedNotification()
returns a callable value in case a persistent connection is in progress; NOTHING if not; this method ...
private any sendImpl()
callback method for sending chunked data; this calls RestHandler::AbstractRestStreamRequestHandler::s...
private hash dispatchStream(HttpListenerInterface listener, RestHandler rh, Socket s, string mn, *hash ah, hash cx)
this method is called to dispatch streamed requests on the given object
bool isPersistent()
returns True if the connection is persistent; this method in the base class returns False by default ...
private hash unknownSubClassError(string n_name)
throws a "REST-CLASS-ERROR" exception when a request tries to access an unknown subclass ...
abstract string name()
this provides the name of the REST class
abstract hash getResponseHeaderMessageImpl()
this method should return the response message description hash
private hash dispatch(RestHandler rh, string mn, *hash ah, hash cx)
this method is called to dispatch requests on the given object
*hash ex
if an exception is raised in a callback then the exception hash is saved here
Definition: RestHandler.qm.dox.h:338
hash rhdr
headers to add in the response
Definition: RestHandler.qm.dox.h:344
abstract nothing recvImpl(hash v)
abstract callback method for receiving chunked data
any send()
this method provides the callback method for sending chunked data by calling sendImpl() ...
constructor(hash n_cx, *hash n_ah)
creates the object with the given arguments
hash handleRequest(HttpListenerInterface 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 ...
setTimeout(timeout n_timeout_ms)
sets the internal socket I/O timeout value in ms