mirror of
https://github.com/me-no-dev/ESPAsyncWebServer.git
synced 2026-01-27 01:02:19 +01:00
Add ESP32 equivalent of beginResponse_P for embedded binary data.
`AsyncWebServerResponse* beginResponse(int code, const String& contentType, const uint8_t* content, size_t len, AwsTemplateProcessor callback = nullptr);` Ref: https://docs.platformio.org/en/latest/platforms/espressif32.html#embedding-binary-data
This commit is contained in:
@@ -702,6 +702,10 @@ AsyncWebServerResponse* AsyncWebServerRequest::beginResponse(int code, const Str
|
||||
return new AsyncBasicResponse(code, contentType, content);
|
||||
}
|
||||
|
||||
AsyncWebServerResponse* AsyncWebServerRequest::beginResponse(int code, const String& contentType, const uint8_t* content, size_t len, AwsTemplateProcessor callback) {
|
||||
return new AsyncProgmemResponse(code, contentType, content, len, callback);
|
||||
}
|
||||
|
||||
AsyncWebServerResponse* AsyncWebServerRequest::beginResponse(FS& fs, const String& path, const String& contentType, bool download, AwsTemplateProcessor callback) {
|
||||
if (fs.exists(path) || (!download && fs.exists(path + F(".gz"))))
|
||||
return new AsyncFileResponse(fs, path, contentType, download, callback);
|
||||
|
||||
Reference in New Issue
Block a user