![]() |
Qore RestHandler Module Reference 1.6.3
|
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 timeout_ms) | |
| sets the internal socket I/O timeout value in ms | |
| streamError (hash< auto > 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 | the call context hash; see REST Handler Context Argument for information about this value |
| 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 response| abstract 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 response| nothing 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