public Dictionary <string, int> getTestAdminData() { Dictionary <string, int> result = new Dictionary <string, int>(); con = new ConnectionWrapper(location); object response = con.getRequest("/admins"); JArray responseEntities = JArray.Parse(response.ToString()); JArray patientList = JArray.Parse(responseEntities[0].ToString()); foreach (JObject patient in patientList) { int id = 0; string name = null; JToken value; if (patient.TryGetValue("Id", out value)) { id = value.ToObject <int>(); } if (patient.TryGetValue("Name", out value)) { name = value.ToObject <string>(); } result.Add(name, id); } Debug.Log(result.ToString()); return(result); }
public void PushDataLog() { Debug.Log("Pushed event_log to Server via API call"); Debug.Log(event_log); con = new ConnectionWrapper(location); con.postRequest("/events", event_log); event_log.Clear(); }