mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
shrink API-json before sending
This commit is contained in:
@@ -85,6 +85,7 @@ void WebAPIService::webAPIService(AsyncWebServerRequest * request) {
|
|||||||
}
|
}
|
||||||
if (ok && json.size()) {
|
if (ok && json.size()) {
|
||||||
// send json output back to web
|
// send json output back to web
|
||||||
|
doc.shrinkToFit();
|
||||||
std::string buffer;
|
std::string buffer;
|
||||||
serializeJsonPretty(doc, buffer);
|
serializeJsonPretty(doc, buffer);
|
||||||
request->send(200, "text/plain", buffer.c_str());
|
request->send(200, "text/plain", buffer.c_str());
|
||||||
|
|||||||
Reference in New Issue
Block a user