IEnumerator FetchPatientDiagnosisData() { // we fetch first the patients. UnityWebRequest www = UnityWebRequest.Get(apiURL + "patient/diagnosis"); var resp = www.SendWebRequest(); yield return(resp); if (string.IsNullOrEmpty(www.error)) { //Success } if (www.isNetworkError || www.isHttpError) { Debug.Log(www.error); } else { // Show results as text string response = www.downloadHandler.text; Debug.Log(response); // save data into patientData.json FileManager.SaveFile(PatientDiagnosis.fileName, response); PatientDiagnosis.All(); // Or retrieve results as binary data //byte[] results = www.downloadHandler.data; } }
void Start() { foreach (KeyValuePair <string, Diagnostic> k_d in Diagnostic.All()) { Debug.Log(k_d.Value); } foreach (PatientDiagnosis p_d in PatientDiagnosis.All()) { Debug.Log(p_d); } Patient.getAll(); }