Ejemplo n.º 1
0
        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;
        }
Ejemplo n.º 2
0
        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;
        }