Computes the length of the minified JSON document that JsonArray::printTo()
produces, excluding the null-terminator.
This function is handy to fill the Content-Length
header.
size_t measureLength() const
Return value
The number of characters that JsonArray::printTo()
produces, excluding the null-terminator.
// Send headers
client.println("Content-Type: application/json");
client.print("Content-Length: ");
client.println(root.measureLength());
// Terminate headers
client.println();
// Send body
root.printTo(client);
See also
JsonArray::printTo()
JsonArray::measurePrettyLength()
JsonObject::measureLength()
JsonVariant::measureLength()
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