Description

JsonVariant::getMember() gets the value associated with the specified key; it reproduces JsonObject::getMember().

If the JsonVariant points to an object, this function returns a JsonVariant pointing to the specified member.

If the JsonVariant does not point to an object, this function returns a null JsonVariant.

Instead of this function, you can use JsonVariant::operator[] which offers a more intuitive syntax.

Signatures

JsonVariant getMember(const char* key) const;
JsonVariant getMember(const String& key) const;
JsonVariant getMember(const std::string& key) const;
JsonVariant getMember(std::string_view key) const;  // 🆕 (added in 6.18.1)
JsonVariant getMember(const __FlashStringHelper* key) const;

Arguments

key: the key of the value in the object.

Return value

JsonVariant::getMember() returns a JsonVariant that points to the requested value.

JsonVariant::getMember() return null when no match is found.

See also