mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 08:19:52 +03:00
rename json sizes
This commit is contained in:
@@ -71,7 +71,7 @@ void WebAPIService::webAPIService(AsyncWebServerRequest * request) {
|
||||
id = "-1";
|
||||
}
|
||||
|
||||
DynamicJsonDocument doc(EMSESP_MAX_JSON_SIZE_DYN);
|
||||
DynamicJsonDocument doc(EMSESP_MAX_JSON_SIZE_MEDIUM_DYN);
|
||||
JsonObject json = doc.to<JsonObject>();
|
||||
bool ok = false;
|
||||
|
||||
@@ -109,9 +109,9 @@ void WebAPIService::webAPIService(AsyncWebServerRequest * request) {
|
||||
|
||||
// if we have returned data in JSON format, send this to the WEB
|
||||
if (json.size()) {
|
||||
char buffer[EMSESP_MAX_JSON_SIZE_DYN];
|
||||
std::string buffer;
|
||||
serializeJsonPretty(doc, buffer);
|
||||
request->send(200, "text/plain", buffer);
|
||||
request->send(200, "text/plain", buffer.c_str());
|
||||
} else {
|
||||
request->send(200, "text/plain", ok ? F("OK") : F("Invalid"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user