tufao
1.3.0
An asynchronous web framework for C++ built on top of Qt
|
This class describes a request handler and a filter. More...
Public Member Functions | |
Mapping (QRegularExpression path, Handler handler) | |
Constructs a Mapping object using path as filter and handler as handler. | |
Mapping (QRegularExpression path, QByteArray method, Handler handler) | |
Constructs a Mapping object using path and method as filters and handler as handler. | |
Mapping ()=default | |
Constructs an empty Mapping object. | |
Public Attributes | |
QRegularExpression | path |
This attribute is used to filter requests based on the url's path component. More... | |
QByteArray | method |
This attribute is used to filter requests based on the HTTP method. More... | |
Handler | handler |
This class describes a request handler and a filter.
The filter is very basic and only can select requests based on the url's path component and, optionally, the http method.
The handlers return a boolean indicating whether it's able to handle the request. You can use this return value to overcome the simplistic nature of the provided filter or to respond requests partially (like fill headers that must be present in every response).
QByteArray Tufao::HttpServerRequestRouter::Mapping::method |
This attribute is used to filter requests based on the HTTP method.
The filter should work by simply comparing strings.
QRegularExpression Tufao::HttpServerRequestRouter::Mapping::path |
This attribute is used to filter requests based on the url's path component.
It's a regular expression, so you have powerful control.