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

Commit 102c84b

Browse files
committed
Split sendRequestGetBody to GetBody
1 parent 9985342 commit 102c84b

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

Firebase.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,13 @@ Firebase& Firebase::auth(const String& auth) {
2828
}
2929

3030
String Firebase::get(const String& path) {
31-
return sendRequestGetBody("GET", path);
31+
sendRequest("GET", path);
32+
return getBody();
3233
}
3334

3435
String Firebase::push(const String& path, const String& value) {
35-
return sendRequestGetBody("POST", path, value);
36+
sendRequest("POST", path, value);
37+
return getBody();
3638
}
3739

3840
bool Firebase::remove(const String& path) {
@@ -87,8 +89,7 @@ int Firebase::sendRequest(const char* method, const String& path, const String&
8789
return statusCode;
8890
}
8991

90-
String Firebase::sendRequestGetBody(const char* method, const String& path, const String& value) {
91-
sendRequest(method, path, value);
92+
String Firebase::getBody() {
9293
if (_error.code() != 0) {
9394
return "";
9495
}

Firebase.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class Firebase {
6565
private:
6666
String makeURL(const String& path);
6767
int sendRequest(const char* method, const String& path, const String& value = "");
68-
String sendRequestGetBody(const char* method, const String& path, const String& value = "");
68+
String getBody();
6969
void checkResponse(const char* method, const String& url, int status_code);
7070

7171
HTTPClient _http;

0 commit comments

Comments
 (0)