550 abstract string name();
573 hash<HttpServer::HttpHandlerResponseInfo> handleRequest(HttpListenerInterface listener,
RestHandler rh, Socket s, *
list cl,
string mn,
hash cx, *
hash args);
579 hash<HttpServer::HttpHandlerResponseInfo> dispatchStream(HttpListenerInterface listener,
RestHandler rh, Socket s,
string mn, *
hash ah,
hash cx);
600 hash<HttpServer::HttpHandlerResponseInfo> dispatch(
RestHandler rh,
string mn, *
hash ah,
hash cx);
607 hash<HttpServer::HttpHandlerResponseInfo> unknownSubClassError(
string n_name);
628 const Err501 =
new hash<HttpResponseInfo>((
630 "body":
"not implemented",
639 "OPTIONS":
"options",
644 const MimeDataTypes = (
646 "serialize": \make_json(),
647 "deserialize": \parse_json(),
650 "serialize": \make_yaml(),
651 "deserialize": \parse_yaml(),
655 "serialize": \make_yaml(),
656 "deserialize": \parse_yaml(),
659 "serialize": \make_xmlrpc_value(),
660 "deserialize": \parse_xmlrpc_value(),
663 "serialize":
string (
auto v) {
664 switch (v.typeCode());
666 return make_xml((
"value": v));
668 "deserialize":
hash (
string xml) {
670 return parse_xmlrpc_value(xml);
672 catch (hash<ExceptionInfo>
ex);
681 "serialize":
string (
auto body) {
return sprintf(
"<pre>%N</pre>", body); },
732 auto handleExternalRequest(
string method,
string path, *
hash body,
hash cx = {});
760 hash<HttpResponseInfo> handleRequest(HttpListenerInterface listener, Socket s,
hash cx,
hash hdr, *data b);
764 removeRootPath(reference<string> path);
768 requestDeserializationError(
hash hdr,
hash cx,
string body);
780 logError(
string fmt);
784 logDebug(
string fmt);
796 static hash makeResponse(
int code,
auto body, *
hash hdr);
803 class DummyListenerInterface :
public HttpListenerInterface {
806 addUserThreadContext(
hash uctx);
809 auto removeUserThreadContext(*
string k);
815 logError(
string fmt);
string sprintf(string fmt,...)
hash ch
class hash: name -> AbstractRestClass
Definition: RestHandler.qm.dox.h:689
*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:356
string mime_get_form_urlencoded_string(hash h)
hash< HttpServer::HttpHandlerResponseInfo > getResponseHeaderMessage()
this method returns the response message description hash by calling getResponseHeaderMessageImpl() ...
the RestHandler namespace contains all the objects in the RestHandler module
Definition: RestHandler.qm.dox.h:338
const MimeTypeFormUrlEncoded
hash mime_parse_form_urlencoded_string(string str)
nothing recv(hash v)
this method provides the callback method for receiving chunked data by calling recvImpl() ...
abstract auto sendImpl()
abstract callback method for sending chunked data
*hash ah
call argument hash
Definition: RestHandler.qm.dox.h:362
the base abstract class for REST stream request handlers
Definition: RestHandler.qm.dox.h:347
the base abstract class for REST handler classes
Definition: RestHandler.qm.dox.h:539
the base class for handling HTTP chunked requests and responses within the RestHandler infrastructure...
Definition: RestHandler.qm.dox.h:477
RestSchemaValidator::AbstractRestSchemaValidator validator
REST schema validator.
Definition: RestHandler.qm.dox.h:695
auto send()
this method provides the callback method for sending chunked data by calling sendImpl() ...
*int timeout_ms
socket I/O timeout in milliseconds
Definition: RestHandler.qm.dox.h:368
*code getPersistentClosedNotification()
returns a callable value in case a persistent connection is in progress; NOTHING if not; this method ...
bool isPersistent()
returns True if the connection is persistent; this method in the base class returns False by default ...
Definition: RestHandler.qm.dox.h:801
abstract hash getResponseHeaderMessageImpl()
this method should return the response message description hash
*hash ex
if an exception is raised in a callback then the exception hash is saved here
Definition: RestHandler.qm.dox.h:359
hash rhdr
headers to add in the response
Definition: RestHandler.qm.dox.h:365
abstract nothing recvImpl(hash v)
abstract callback method for receiving chunked data
constructor(hash n_cx, *hash n_ah)
creates the object with the given arguments
setTimeout(timeout n_timeout_ms)
sets the internal socket I/O timeout value in ms