shrink API-json before sending

This commit is contained in:
MichaelDvP
2021-02-01 11:18:22 +01:00
parent 135b122ceb
commit 4935c4c208

View File

@@ -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());