ESP32 HTTPS Server

Public Member Functions | Public Attributes | List of all members
httpsserver::HTTPNode Class Referenceabstract

Base class for a URL/route-handler in the server. More...

`#include <HTTPNode.hpp>`

Inheritance diagram for httpsserver::HTTPNode:
[legend]

## Public Member Functions
| HTTPNode (const std::string &path, const HTTPNodeType nodeType, const std::string &tag="")
bool | hasUrlParameter ()
uint8_t | getUrlParamCount ()
size_t | getParamIdx (uint8_t)
std::vector< HTTPValidator * > * | getValidators ()
virtual std::string | getMethod ()=0
void | addURLParamValidator (uint8_t paramIdx, const HTTPValidationFunction *validator)

## Public Attributes
const std::string | _path
const std::string | _tag
const HTTPNodeType | _nodeType

## Detailed Description

Base class for a URL/route-handler in the server.

Use ResourceNode for requests that access dynamic or static resources or HttpNode for routes that create Websockets.

## Member Function Documentation

## ◆ addURLParamValidator()

void httpsserver::HTTPNode::addURLParamValidator | ( | uint8_t | paramIdx,
|  | const HTTPValidationFunction * | validator
| ) |  |

Adds a validation function that checks if the actual value of a parameter matches the expectation

Parameters

  paramIdx | defines the ID of the parameter that should be checked (starts by 0)
  validator | the function (string -> bool) that checks if the parameter matches the expecatation

See also
  ValidatorFunctions.hpp if you need some predefined templates for functions

## Member Data Documentation

## ◆ _nodeType

const HTTPNodeType httpsserver::HTTPNode::_nodeType

Stores the type of the node (as we have not runtime type information by default)

## ◆ _path

const std::string httpsserver::HTTPNode::_path

The path under which this node will be available. Should start with a slash. Example: "/myResource"

## ◆ _tag

const std::string httpsserver::HTTPNode::_tag

Stores a tag that can be used in middleware and handler functions to identify this specific node, tag the node with a required permission, ...

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

- /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPNode.hpp
- /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPNode.cpp