mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2026-01-26 08:42:19 +01:00
Implement sending content from progmem
make the example editor run from progmem
This commit is contained in:
@@ -673,6 +673,14 @@ AsyncResponseStream * AsyncWebServerRequest::beginResponseStream(String contentT
|
||||
return new AsyncResponseStream(contentType, bufferSize);
|
||||
}
|
||||
|
||||
AsyncWebServerResponse * AsyncWebServerRequest::beginResponse_P(int code, String contentType, const uint8_t * content, size_t len){
|
||||
return new AsyncProgmemResponse(code, contentType, content, len);
|
||||
}
|
||||
|
||||
AsyncWebServerResponse * AsyncWebServerRequest::beginResponse_P(int code, String contentType, PGM_P content){
|
||||
return beginResponse_P(code, contentType, (const uint8_t *)content, strlen_P(content));
|
||||
}
|
||||
|
||||
void AsyncWebServerRequest::send(int code, String contentType, String content){
|
||||
send(beginResponse(code, contentType, content));
|
||||
}
|
||||
@@ -701,6 +709,14 @@ void AsyncWebServerRequest::sendChunked(String contentType, AwsResponseFiller ca
|
||||
send(beginChunkedResponse(contentType, callback));
|
||||
}
|
||||
|
||||
void AsyncWebServerRequest::send_P(int code, String contentType, const uint8_t * content, size_t len){
|
||||
send(beginResponse_P(code, contentType, content, len));
|
||||
}
|
||||
|
||||
void AsyncWebServerRequest::send_P(int code, String contentType, PGM_P content){
|
||||
send(beginResponse_P(code, contentType, content));
|
||||
}
|
||||
|
||||
void AsyncWebServerRequest::redirect(String url){
|
||||
AsyncWebServerResponse * response = beginResponse(302);
|
||||
response->addHeader("Location",url);
|
||||
|
||||
Reference in New Issue
Block a user