Description

Computes the length of the minified MessagePack document that serializeMsgPack() produces.

Signature

size_t measureMsgPack(const JsonDocument& doc);

Return value

The number of characters that serializeMsgPack()produces.

Example

// Send headers
client.println("Content-Type: application/msgpack");
client.print("Content-Length: ");
client.println(measureMsgPack(doc));

// Terminate headers
client.println();

// Send body
serializeMsgPack(doc, client);

See also