public void PostRun(FileData data) { Hashtable headers = new Hashtable(); headers.Add("Content-Type", "application/json"); var uri = CognitoUrl + @"forms/api/" + CognitoAPIKey + @"/forms/" + FileDataFormName + @"/entry"; var jsonObj = new JSON(); jsonObj.AddLine("$type", "Cognito.Forms.FormEntry." + CognitoOrganizationName + "." + FileDataFormName); jsonObj.AddLine("$version", "6"); jsonObj.AddLine("$etag", "c6dbbee3-f990-4312-9906-8cd82bf8df4e"); jsonObj.AddLine("Level", GameManager.GetLevelDisplayName(data.Level)); jsonObj.AddLine("Username", data.Username); jsonObj.AddLine("Id1", data.ID); jsonObj.AddLine("UserId", data.UserID); jsonObj.AddLine("Time", data.Time.ToString()); Debug.Log(jsonObj.ToString()); queue.Enqueue(new Request(uri, jsonObj.ToString(), RequestType.Post, returnFunction: null, retry: true)); }
public void PostProfile(ProfileData profile) { Hashtable headers = new Hashtable(); headers.Add("Content-Type", "application/json"); var uri = CognitoUrl + @"forms/api/" + CognitoAPIKey + @"/forms/" + ProfileFormName + @"/entry"; var jsonObj = new JSON(); jsonObj.AddLine("$type", "Cognito.Forms.FormEntry." + CognitoOrganizationName + "." + ProfileFormName); jsonObj.AddLine("$version", "6"); jsonObj.AddLine("$etag", "c6dbbee3-f990-4312-9906-8cd82bf8df4e"); jsonObj.AddLine("Username", profile.UserName); jsonObj.AddLine("Email", profile.Email); jsonObj.AddLine("Id1", profile.ID); jsonObj.AddLine("Password", profile.Password); Debug.Log(jsonObj.ToString()); queue.Enqueue(new Request(uri, jsonObj.ToString(), RequestType.Post, returnFunction: null, retry: true)); }