// and has key1 and key2 repsectively
std::cout << "\treps[0].key1: " << myGarage.m_reps[0].getValue<int>("key1") << std::endl;
std::cout << "\treps[0].key2: " << myGarage.m_reps[1].getValue<int>("key2") << std::endl;
+
+ std::cout << "\tjson: " << rep.getValue<std::string>("json") << std::endl;
}
// callback handler on PUT request
void onPut(const HeaderOptions& headerOptions, const OCRepresentation& rep, const int eCode)
// storing array of representations
m_garageRep.setValue("reps", m_reps);
+
+
+ // setting json string
+ std::string json = "{\"num\":10,\"rno\":23.5,\"aoa\":[[1,2],[3]],\"str\":\"john\",\
+\"object\":{\"bl1\":false,\"ar\":[2,3]}, \"objects\":[{\"bl2\":true,\"nl\":null},{\"ar1\":[1,2]}]}";
+ m_garageRep.setValue("json", escapeString(json));
}
/* Note that this does not need to be a member function: for classes you do not have