1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-16 11:21:18 +03:00

send_P, sendContent_P, and FPSTR

This allows for the content of server response to be stored in flash
memory.
This commit is contained in:
Makuna
2015-07-24 12:41:26 -07:00
parent cc8fb10e21
commit 8fa156d356
4 changed files with 99 additions and 26 deletions

View File

@ -80,10 +80,12 @@ public:
void send(int code, const char* content_type = NULL, const String& content = String(""));
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 setContentLength(size_t contentLength) { _contentLength = contentLength; }
void sendHeader(const String& name, const String& value, bool first = false);
void sendContent(const String& content);
void sendContent_P(PGM_P content);
template<typename T> size_t streamFile(T &file, const String& contentType){
setContentLength(file.size());
@ -104,7 +106,8 @@ protected:
void _parseForm(WiFiClient& client, String boundary, uint32_t len);
void _uploadWriteByte(uint8_t b);
uint8_t _uploadReadByte(WiFiClient& client);
void _prepareHeader(String& response, int code, const char* content_type, size_t contentLength);
struct RequestHandler;
struct RequestArgument {
String key;