tufao  0.8.1
An asynchronous web framework for C++ built on top of Qt
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
Tufao::AbstractHttpServerRequestHandler Class Referenceabstract

This class provides an interface for HttpServerRequest handlers. More...

+ Inheritance diagram for Tufao::AbstractHttpServerRequestHandler:
+ Collaboration diagram for Tufao::AbstractHttpServerRequestHandler:

Public Slots

virtual bool handleRequest (Tufao::HttpServerRequest *request, Tufao::HttpServerResponse *response, const QStringList &args=QStringList())=0
 Handles the request using the response object. More...
 

Public Member Functions

 AbstractHttpServerRequestHandler (QObject *parent=0)
 Constructs an AbstractHttpServerRequestHandler object.
 

Detailed Description

This class provides an interface for HttpServerRequest handlers.

A request handler is usually registered to handle requests matching some set of rules and usually used with a set of other handlers.

A sample request handler is given below:

bool RequestHandler::handleRequest(Tufao::HttpServerRequest *request,
const QStringList &args)
{
response->writeHead(200);
response->end("Hello World\n");
return true;
}
See Also
HttpServerRequestRouter
Since
0.3

Member Function Documentation

virtual bool Tufao::AbstractHttpServerRequestHandler::handleRequest ( Tufao::HttpServerRequest request,
Tufao::HttpServerResponse response,
const QStringList &  args = QStringList() 
)
pure virtualslot

Handles the request using the response object.

Parameters
argsA list of options that may be used by the handler. The HttpServerRequestRouter class uses this argument to send the captured texts in the regex pattern.
Return values
trueIf the handler has responded to the request.
falseIf the requested page can't be generated by this handler. The connection should remain open and the response object shouldn't be used, leaving the response free to be used by other handlers in the chain.

The documentation for this class was generated from the following file: