A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/esp8266/Arduino/issues/7075 below:

ESP8266WebServer::client() should return a reference · Issue #7075 · esp8266/Arduino · GitHub

Hi,

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.

(see also this question on StackOverflow)

Best regards,
Benoit

d-a-v, edgar-bonet and TheNitek


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4