ESP32 HTTPS Server: /home/frank/Projekte/esp32/https_server/esp32_https_server/src/HTTPRequest.hpp Source File

1 #ifndef SRC_HTTPREQUEST_HPP_

2 #define SRC_HTTPREQUEST_HPP_

3 

4 #include <Arduino.h>

5 #include <IPAddress.h>

6 #include <string>

7 

8 #include <mbedtls/base64.h>

9 

10 #include "ConnectionContext.hpp"

11 #include "HTTPNode.hpp"

12 #include "HTTPHeader.hpp"

13 #include "HTTPHeaders.hpp"

14 #include "ResourceParameters.hpp"

15 #include "util.hpp"

16 

18 

23 public:

26 

27  std::string getHeader(std::string const &name);

28  void setHeader(std::string const &name, std::string const &value);

30  std::string getRequestString();

31  std::string getMethod();

32  std::string getTag();

33  IPAddress getClientIP();

34 

35  size_t readChars(char * buffer, size_t length);

36  size_t readBytes(byte * buffer, size_t length);

37  size_t getContentLength();

38  bool requestComplete();

42  std::string getBasicAuthUser();

43  std::string getBasicAuthPassword();

44  bool isSecure();

46 

47 private:

48  std::string decodeBasicAuthToken();

49 

51 

53 

55 

56  std::string _method;

57 

59 

60  std::string _requestString;

61 

62  bool _contentLengthSet;

63  size_t _remainingContent;

64 };

65 

66 }

67 

68 #endif

Represents the request stream for an HTTP request.

Definition: HTTPRequest.hpp:22

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

Definition: HTTPNode.hpp:26

void discardRequestBody()

Definition: HTTPRequest.cpp:116

The ResourceParameters provide access to the parameters passed in the URI.

Definition: ResourceParameters.hpp:31

Definition: WebsocketHandler.hpp:34

Internal class to handle the state of a connection.

Definition: ConnectionContext.hpp:18

Definition: ConnectionContext.cpp:3