Skip to content
This repository was archived by the owner on Mar 17, 2025. It is now read-only.

Commit 4cae3f8

Browse files
committed
Merge pull request #47 from proppy/set
firebase: add set looks good to me.
2 parents 18deb49 + 7561f36 commit 4cae3f8

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

Firebase.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ void Firebase::remove(const String& path) {
4141
sendRequest("DELETE", path);
4242
}
4343

44+
String Firebase::set(const String& path, const String& value) {
45+
sendRequest("PUT", path, value);
46+
return readBody();
47+
}
48+
4449
Firebase& Firebase::stream(const String& path) {
4550
_error.reset();
4651
String url = makeURL(path);

Firebase.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ class Firebase {
5151
return _error;
5252
}
5353
String get(const String& path);
54+
// write a new JSON `value` to the given `path`.
55+
// Note: A String `value` must include double quotes to be valid json.
56+
String set(const String& path, const String& value);
57+
// append a new JSON `value` to the given `path`.
58+
// Note: A String `value` must include double quotes to be valid json.
5459
String push(const String& path, const String& value);
5560
void remove(const String& path);
5661
bool connected();

0 commit comments

Comments
 (0)