String FirebaseArduino::push(const String& path, const JsonVariant& value) {
  String buf;
  value.printTo(buf);
  auto push = FirebasePush(host_, auth_, path.c_str(), buf.c_str(), http_.get());
  error_ = push.error();
  return push.name().c_str();
}
Exemple #2
0
void jsonResponse(AsyncWebServerRequest *request, int res, JsonVariant json)
{
  // touch
  g_lastAccessTime = millis();

  AsyncResponseStream *response = request->beginResponseStream(F(CONTENT_TYPE_JSON));
  response->addHeader(F(CORS_HEADER), "*");
  json.printTo(*response);
  request->send(response);
}
void FirebaseArduino::set(const String& path, const JsonVariant& value) {
  String buf;
  value.printTo(buf);
  auto set = FirebaseSet(host_, auth_, path.c_str(), buf.c_str(), http_.get());
  error_ = set.error();
}
 void outputMustBe(const char *expected) {
   char buffer[256] = "";
   size_t n = variant.printTo(buffer, sizeof(buffer));
   EXPECT_STREQ(expected, buffer);
   EXPECT_EQ(strlen(expected), n);
 }