public static bool Update(Student student) { try { StudentManager.Update(student); } catch (Exception) { return false; } return true; }
public static bool Update(Student student) { var http = new HttpClient(ServiceURL); var uri = "student/update"; // get return string from server var res = http.Put(uri, HttpContent.Create(JsonConvert.SerializeObject(student))); var stream = res.Content.ReadAsStream(); var result = new StreamReader(stream).ReadToEnd(); if (result == "true") return true; return false; }