![]() |
Qore RestHandler Module Reference 1.6.2
|
the base abstract class for REST stream request handlers More...
#include <RestHandler.qm.dox.h>
Public Member Methods | |
constructor (hash< auto > cx, *hash< auto > ah) | |
creates the object with the given arguments | |
*code | getPersistentClosedNotification () |
returns a callable value in case a persistent connection is in progress; NOTHING if not; this method in the base class returns NOTHING | |
hash< HttpServer::HttpHandlerResponseInfo > | getResponseHeaderMessage () |
this method returns the response message description hash by calling getResponseHeaderMessageImpl() | |
abstract hash< auto > | getResponseHeaderMessageImpl () |
this method should return the response message description hash | |
*int | getTimeout () |
returns the timeout in milliseconds or NOTHING if no timeout is set | |
bool | isPersistent () |
returns True if the connection is persistent; this method in the base class returns False by default | |
nothing | recv (hash< auto > v) |
this method provides the callback method for receiving chunked data by calling recvImpl() | |
abstract nothing | recvImpl (hash< auto > v) |
abstract callback method for receiving chunked data | |
auto | send () |
this method provides the callback method for sending chunked data by calling sendImpl() | |
abstract auto | sendImpl () |
abstract callback method for sending chunked data | |
setTimeout (timeout n_timeout_ms) | |
sets the internal socket I/O timeout value in ms | |
streamError (hash< auto > n_ex) | |
registers stream errors in the send operation with the stream handler if no error is already present | |
the base abstract class for REST stream request handlers
The calling order is as follows:
RestHandler::AbstractRestStreamRequestHandler::constructor | ( | hash< auto > | cx, |
*hash< auto > | ah | ||
) |
creates the object with the given arguments
cx | call context hash; this hash will have the following keys:
|
ah | any URI arguments in the request |
hash< HttpServer::HttpHandlerResponseInfo > RestHandler::AbstractRestStreamRequestHandler::getResponseHeaderMessage | ( | ) |
this method returns the response message description hash by calling getResponseHeaderMessageImpl()
"code"
: the HTTP return code (see HttpServer::HttpCodes)"body"
: the message body to return in the response; if this key is returned, then the reply is sent immediately; a chunked reply is not made, and send() and sendImpl() are not called"close"
: (optional) set this key to True if the connection should be unconditionally closed when the handler returns"hdr"
: (optional) set this key to a hash of extra header information to be returned with the responseabstract hash< auto > RestHandler::AbstractRestStreamRequestHandler::getResponseHeaderMessageImpl | ( | ) |
this method should return the response message description hash
"code"
: the HTTP return code (see HttpServer::HttpCodes)"body"
: the message body to return in the response; if this key is returned, then the reply is sent immediately; a chunked reply is not made, and send() and sendImpl() are not called"close"
: (optional) set this key to True if the connection should be unconditionally closed when the handler returns"hdr"
: (optional) set this key to a hash of extra header information to be returned with the responsenothing RestHandler::AbstractRestStreamRequestHandler::recv | ( | hash< auto > | v | ) |
this method provides the callback method for receiving chunked data by calling recvImpl()
v | the first time this method is called with a hash of the message headers in the "hdr" key, and then with any message body in the "data" ; if a chunked HTTP message is received, then this method is called once for each chunk; when the message has been received, then this method is called with a hash representing any trailer data received in a chunked transfer or NOTHING if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys:
|
abstract nothing RestHandler::AbstractRestStreamRequestHandler::recvImpl | ( | hash< auto > | v | ) |
abstract callback method for receiving chunked data
v | the first time this method is called with a hash of the message headers in the "hdr" key, and then with any message body in the "data" ; if a chunked HTTP message is received, then this method is called once for each chunk; when the message has been received, then this method is called with a hash representing any trailer data received in a chunked transfer or NOTHING if the data was received in a normal message body or if there was no trailer data in a chunked transfer. The argument to this callback is always a hash; data calls have the following keys:
|
auto RestHandler::AbstractRestStreamRequestHandler::send | ( | ) |
this method provides the callback method for sending chunked data by calling sendImpl()
abstract auto RestHandler::AbstractRestStreamRequestHandler::sendImpl | ( | ) |
abstract callback method for sending chunked data