Stellarium  0.90.0
List of all members | Public Member Functions
HttpRequestHandler Class Reference

The request handler generates a response for each HTTP request. More...

#include <httprequesthandler.h>

+ Inheritance diagram for HttpRequestHandler:
+ Collaboration diagram for HttpRequestHandler:

Public Member Functions

 HttpRequestHandler (QObject *parent=Q_NULLPTR)
 Constructor. More...
 
virtual ~HttpRequestHandler ()
 Destructor. More...
 
virtual void service (HttpRequest &request, HttpResponse &response)
 Generate a response for an incoming HTTP request. More...
 

Detailed Description

The request handler generates a response for each HTTP request.

Web Applications usually have one central request handler that maps incoming requests to several controllers (servlets) based on the requested path.

You need to override the service() method or you will always get an HTTP error 501.

Warning
Be aware that the main request handler instance must be created on the heap and that it is used by multiple threads simultaneously.
See also
StaticFileController which delivers static local files.

Definition at line 26 of file httprequesthandler.h.

Constructor & Destructor Documentation

HttpRequestHandler::HttpRequestHandler ( QObject *  parent = Q_NULLPTR)

Constructor.

Parameters
parentParent object.
virtual HttpRequestHandler::~HttpRequestHandler ( )
virtual

Destructor.

Member Function Documentation

virtual void HttpRequestHandler::service ( HttpRequest request,
HttpResponse response 
)
virtual

Generate a response for an incoming HTTP request.

Parameters
requestThe received HTTP request
responseMust be used to return the response
Warning
This method must be thread safe

Reimplemented in StaticFileController, RequestHandler, and APIController.


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