1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-28 05:01:28 +03:00

ESP8266WebServer: Add variadic template version of collectHeaders() (#7296)

* More user-friendly, less RODATA usage.

eg. `webServer.collectHeaders(F("Content-Type"), F("Origin"));`

In this example, less about 20 bytes than the traditional way.
This commit is contained in:
Takayuki 'January June' Suwa
2021-03-15 11:55:25 +09:00
committed by GitHub
parent 8ffe41b7df
commit 47b8947e72
3 changed files with 20 additions and 13 deletions

View File

@ -138,6 +138,8 @@ public:
int args() const; // get arguments count
bool hasArg(const String& name) const; // check if argument exists
void collectHeaders(const char* headerKeys[], const size_t headerKeysCount); // set the request headers to collect
template<typename... Args>
void collectHeaders(const Args&... args); // set the request headers to collect (variadic template version)
const String& header(const String& name) const; // get request header value by name
const String& header(int i) const; // get request header value by number
const String& headerName(int i) const; // get request header name by number