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

firebase: add set #47

Merged
merged 1 commit into from
Jan 20, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions Firebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions Firebase.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down