public async Task SaveAppAsync(AppToSend item) { var json = await Task.Run(() => JsonConvert.SerializeObject(item)); var content = await Task.Run(() => new StringContent("data=" + json, Encoding.UTF8, "application/json")); HttpResponseMessage response = null; response = await client.PostAsync("http://timekeeperapi.azurewebsites.net/api.php/table4", content); }
public void setAllApps(string name, string classification) { foreach (User user in userList) { foreach (AppData app in user.getApplicationLog()) { if (app.getName().Equals(name)) { app.setClassification(classification); } } } AppToSend myAppToSend = new AppToSend(name, classification); setAppDatabase(myAppToSend); }
public async void setAppDatabase(AppToSend item) { RestService myService = new RestService(); await myService.SaveAppAsync(item); }