Closed nakulbende closed 5 years ago
Hi @nakulbende,
You need to serialize the JSON document to a string first:
String json;
desklamp.printTo(json);
int httpCode = http.POST(json);
I don't think there is an easy way to avoid the temporary string with this library.
Regards, Benoit
Works like a charm!
Thanks for the quick solution.
You're welcome! Thanks for using ArduinoJson.
Making a esp8266 device on Blynk that can toggle/ control TP-link bulbs. The bulbs accept settings as a http POST with json object. Details are here. In the following code, if I just try to get json object printed, it formats perfectly and outputs on serial. But if I try to use the object with httpclient library, and submit a POST query, I get an error:
no matching function for call to 'HTTPClient::POST(ArduinoJson::JsonObject&)'
I am fairly new to both json and httpclient - if somebody can guide me it would be a great learning experience!
Thanks in advance!
Code:
Compiler error: