In order to make this work with the current ArduinoJson V6.16.1, I replaced in functiom "server.on("/api", []() {}" around line 82:
//build json object of program data
const int capacity = JSON_OBJECT_SIZE(3);
StaticJsonDocument<capacity> doc;
// JsonObject json = jsonDoc.as<JsonObject>();
doc["x"] = x;
doc["y"] = y;
char jsonchar[200];
serializeJson(doc, jsonchar); //print to char array, takes more memory but sends in one piece
DEBUG_PRINT(jsonchar);
Hello,
I tested the example spiffs_rest_api_nonblocking.
In order to make this work with the current ArduinoJson V6.16.1, I replaced in functiom "server.on("/api", []() {}" around line 82:
Regards
Joachim Werner