public static async Task<bool> UpdateBook(Book book) { string jsonObj = JsonConvert.SerializeObject(book); HttpContent content = new StringContent(jsonObj, Encoding.UTF8, "application/json"); HttpResponseMessage response = await DAO.Client.PutAsync("api/books/", content); return response.IsSuccessStatusCode; }
public static async Task<bool> RemoveBookFromUser(int id, Book book) { string jsonObj = JsonConvert.SerializeObject(book); HttpContent content = new StringContent(jsonObj, Encoding.UTF8, "application/json"); HttpResponseMessage response = await DAO.Client.PostAsync($"api/users/removebook/{id}", content); return response.IsSuccessStatusCode; }