diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp b/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp index 326ed24bc..2bd6bbea1 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.cpp @@ -169,6 +169,13 @@ void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content) { sendContent_P(content); } +void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength) { + String header; + _prepareHeader(header, code, String(FPSTR(content_type)).c_str(), contentLength); + sendContent(header); + sendContent_P(content, contentLength); +} + void ESP8266WebServer::send(int code, char* content_type, const String& content) { send(code, (const char*)content_type, content); } diff --git a/libraries/ESP8266WebServer/src/ESP8266WebServer.h b/libraries/ESP8266WebServer/src/ESP8266WebServer.h index 4f455c377..fad9fc55c 100644 --- a/libraries/ESP8266WebServer/src/ESP8266WebServer.h +++ b/libraries/ESP8266WebServer/src/ESP8266WebServer.h @@ -90,6 +90,7 @@ public: void send(int code, char* content_type, const String& content); void send(int code, const String& content_type, const String& content); void send_P(int code, PGM_P content_type, PGM_P content); + void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength); void setContentLength(size_t contentLength) { _contentLength = contentLength; } void sendHeader(const String& name, const String& value, bool first = false);