557 abstract string name();
580 hash<HttpServer::HttpHandlerResponseInfo> handleRequest(HttpListenerInterface listener,
RestHandler rh, Socket s, *
list cl,
string mn,
hash cx, *
hash args);
586 hash<HttpServer::HttpHandlerResponseInfo> dispatchStream(HttpListenerInterface listener,
RestHandler rh, Socket s,
string mn, *
hash ah,
hash cx);
607 hash<HttpServer::HttpHandlerResponseInfo> dispatch(
RestHandler rh,
string mn, *
hash ah,
hash cx);
614 hash<HttpServer::HttpHandlerResponseInfo> unknownSubClassError(
string n_name);
635 const Err501 =
new hash<HttpResponseInfo>((
637 "body":
"not implemented",
646 "OPTIONS":
"options",
651 const MimeDataTypes = (
653 "serialize": \make_json(),
654 "deserialize": \parse_json(),
657 "serialize": \make_yaml(),
658 "deserialize": \parse_yaml(),
662 "serialize": \make_yaml(),
663 "deserialize": \parse_yaml(),
666 "serialize": \make_xmlrpc_value(),
667 "deserialize": \parse_xmlrpc_value(),
670 "serialize":
string (
auto v) {
671 switch (v.typeCode());
673 return make_xml((
"value": v));
675 "deserialize":
hash (
string xml) {
677 return parse_xmlrpc_value(xml);
679 catch (hash<ExceptionInfo>
ex);
688 "serialize":
string (
auto body) {
return sprintf(
"<pre>%N</pre>", body); },
739 auto handleExternalRequest(
string method,
string path, *
hash body,
hash cx = {});
767 hash<HttpResponseInfo> handleRequest(HttpListenerInterface listener, Socket s,
hash cx,
hash hdr, *data b);
771 removeRootPath(reference<string> path);
775 requestDeserializationError(
hash hdr,
hash cx,
string body);
787 logError(
string fmt);
791 logDebug(
string fmt);
803 static hash makeResponse(
int code,
auto body, *
hash hdr);
810 class DummyListenerInterface :
public HttpListenerInterface {
813 addUserThreadContext(
hash uctx);
816 auto removeUserThreadContext(*
string k);
822 logError(
string fmt);
string sprintf(string fmt,...)
hash ch
class hash: name -> AbstractRestClass
Definition: RestHandler.qm.dox.h:696
*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:363
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:345
const MimeTypeFormUrlEncoded
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:369
the base abstract class for REST stream request handlers
Definition: RestHandler.qm.dox.h:354
the base abstract class for REST handler classes
Definition: RestHandler.qm.dox.h:546
the base class for handling HTTP chunked requests and responses within the RestHandler infrastructure...
Definition: RestHandler.qm.dox.h:484
RestSchemaValidator::AbstractRestSchemaValidator validator
REST schema validator.
Definition: RestHandler.qm.dox.h:702
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:375
*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:808
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:366
hash rhdr
headers to add in the response
Definition: RestHandler.qm.dox.h:372
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
hash< auto > mime_parse_form_urlencoded_string(string str)
setTimeout(timeout n_timeout_ms)
sets the internal socket I/O timeout value in ms