https://github.com/bblanchon/ArduinoJson/wiki/Encoding-JSON states "The library is designed to send the JSON string to an implementation of the Print interface that is part of Arduino. In the example above we used Serial, but they are many other implementations that would work as well, including: HardwareSerial, SoftwareSerial, LiquidCrystal, EthernetClient, WiFiClient, Wire"
I assume that this should work with ESP8266 WiFiClient too but
"no matching function for call to 'ArduinoJson::JsonObject::printTo(WiFiClient)'"
WiFiClient client = HTTP.client(); client.print(root);
root.prettyPrintTo((Print&)client);is working for me. thanks @me-no-dev
xtensa-lx106-elf-objdump -S yourSketch.elf