ESP_IOT v2.5
IOT ESP Coding
RequestHandler.h
Go to the documentation of this file.
1#ifndef REQUESTHANDLER_H
2#define REQUESTHANDLER_H
3#include "../../Defines.h"
4
6public:
7 virtual ~RequestHandler() { }
8 virtual bool canHandle(HTTPMethod method, String uri) { (void) method; (void) uri; return false; }
9 virtual bool canUpload(String uri) { (void) uri; return false; }
10 virtual bool handle(WebServer& server, HTTPMethod requestMethod, String requestUri) { (void) server; (void) requestMethod; (void) requestUri; return false; }
11 virtual void upload(WebServer& server, String requestUri, HTTPUpload& upload) { (void) server; (void) requestUri; (void) upload; }
12
13 RequestHandler* next() { return _next; }
14 void next(RequestHandler* r) { _next = r; }
15
16private:
17 RequestHandler* _next = nullptr;
18};
19
20#endif //REQUESTHANDLER_H
HTTPMethod
Definition: WebServer.h:33
virtual ~RequestHandler()
Definition: RequestHandler.h:7
void next(RequestHandler *r)
RequestHandler * next()
virtual void upload(WebServer &server, String requestUri, HTTPUpload &upload)
virtual bool canUpload(String uri)
Definition: RequestHandler.h:9
virtual bool canHandle(HTTPMethod method, String uri)
Definition: RequestHandler.h:8
virtual bool handle(WebServer &server, HTTPMethod requestMethod, String requestUri)