A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://arduinojson.org/v6/api/json/measurejson/ below:

measureJson() | ArduinoJson 6

Description

Computes the length of the minified JSON document that serializeJson() produces, excluding the null-terminator.

This function is handy to fill the Content-Length header in an HTTP message.

Signatures
size_t measureJson(const JsonDocument& doc);
Arguments

doc: the JsonDocument to serialize (in fact, you can also use a JsonArray, a JsonObject, or a JsonVariant).

Return value

The number of characters that serializeJson() produces, excluding the null-terminator.

Example
// Send headers
client.println("Content-Type: application/json");
client.print("Content-Length: ");
client.println(measureJson(doc));

// Terminate headers
client.println();

// Send body
serializeJson(doc, client);
See also
  1. Home
  2. Version 6
  3. API
  4. JSON
  5. measureJson()

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