diff --git a/Firebase.cpp b/Firebase.cpp index 40f8dfe1..954689e5 100644 --- a/Firebase.cpp +++ b/Firebase.cpp @@ -41,6 +41,11 @@ void Firebase::remove(const String& path) { sendRequest("DELETE", path); } +String Firebase::set(const String& path, const String& value) { + sendRequest("PUT", path, value); + return readBody(); +} + Firebase& Firebase::stream(const String& path) { _error.reset(); String url = makeURL(path); diff --git a/Firebase.h b/Firebase.h index ac7ff6ca..0b3802a9 100644 --- a/Firebase.h +++ b/Firebase.h @@ -51,6 +51,11 @@ class Firebase { return _error; } String get(const String& path); + // write a new JSON `value` to the given `path`. + // Note: A String `value` must include double quotes to be valid json. + String set(const String& path, const String& value); + // append a new JSON `value` to the given `path`. + // Note: A String `value` must include double quotes to be valid json. String push(const String& path, const String& value); void remove(const String& path); bool connected();