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

add ESP8266WebServer::send_P with contentLength argument

This commit is contained in:
Martin Ayotte 2015-09-06 14:17:23 -04:00
parent 1c9456ac9d
commit 27b67f4adc
2 changed files with 8 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);