diff --git a/API-Reference.md b/API-Reference.md index b798b80..dcc129b 100644 --- a/API-Reference.md +++ b/API-Reference.md @@ -821,6 +821,47 @@ const char* value2 = object.get("toto"); // returns NULL ``` +### JsonObject::measureLength() + +##### Description + +Gets the length of string produced by `JsonObject::printTo()`. + +This can be very handy to fill the `Content-Length` of an HTTP request or response. + +##### Return value + +The number of characters in the JSON string that would be generated by `JsonObject::printTo()`. + +It doesn't include the zero-terminator. + +##### Signature + +```c++ +size_t measureLength() const +``` + + + +### JsonObject::measurePrettyLength() + +##### Description + +Gets the length of string produced by `JsonObject::prettyPrintTo()`. + +##### Return value + +The number of characters in the JSON string that would be generated by `JsonObject::prettyPrintTo()`. + +It doesn't include the zero-terminator. + +##### Signature + +```c++ +size_t measurePrettyLength() const +``` + + ### JsonObject::operator[] ##### Description