mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-04 18:03:20 +03:00
add ESP8266WebServer::send_P with contentLength argument
This commit is contained in:
parent
1c9456ac9d
commit
27b67f4adc
@ -169,6 +169,13 @@ void ESP8266WebServer::send_P(int code, PGM_P content_type, PGM_P content) {
|
|||||||
sendContent_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) {
|
void ESP8266WebServer::send(int code, char* content_type, const String& content) {
|
||||||
send(code, (const char*)content_type, content);
|
send(code, (const char*)content_type, content);
|
||||||
}
|
}
|
||||||
|
@ -90,6 +90,7 @@ public:
|
|||||||
void send(int code, char* content_type, const String& content);
|
void send(int code, char* content_type, const String& content);
|
||||||
void send(int code, const String& 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);
|
||||||
|
void send_P(int code, PGM_P content_type, PGM_P content, size_t contentLength);
|
||||||
|
|
||||||
void setContentLength(size_t contentLength) { _contentLength = contentLength; }
|
void setContentLength(size_t contentLength) { _contentLength = contentLength; }
|
||||||
void sendHeader(const String& name, const String& value, bool first = false);
|
void sendHeader(const String& name, const String& value, bool first = false);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user