0

I am using ESPAsyncWebServer ArduinoJson (6.19.4)

 server.on("/", HTTP_GET, [](AsyncWebServerRequest * request)
    {
      AsyncJsonResponse  *response = request->beginResponseStream("application/json");
      DynamicJsonDocument doc(1024);
      doc["deviceType"] = deviceType;
      for (uint8_t i = 0; i < NUM_RELAYS; i++)
      {
        doc[String(i)] = !configJSON["devices"][i]["ledState"];
      }
      serializeJson(doc, *response);
      request->send(response);
    });

the above code works fine but seems the response doesnt ends, any subsequent calls also doesnt work on the same URL.

Any help please.

Varun
  • 109
  • 4

0 Answers0