tufao  1.3.0
An asynchronous web framework for C++ built on top of Qt
Tufao::HttpServerRequestRouter::Mapping Struct Reference

This class describes a request handler and a filter. More...

+ Collaboration diagram for Tufao::HttpServerRequestRouter::Mapping:

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
 

Detailed Description

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).

Since
1.0

Member Data Documentation

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.

Note
If this attribute is left null, it won't be used by the filter.
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.


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