You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently ESP8266WebServer::client() returns a WiFiClient by value, which forbids passing the result directly to a function taking a Client&.
For example, it causes a compilation error with ArduinoJson:
serializeJson(doc, server.client());
Because serializeJson() takes a Print&, the line above produces the following error:
no instance of overloaded function "serializeJson" matches the argument list -- argument types are: (ArduinoJson6141_0000010::StaticJsonDocument<768U>, WiFiServer::ClientType)
To fix this problem, ESP8266WebServer::client() must return a reference (and not a copy), just as HTTPClient::getStream() does.