public async Task Delete(string id) { HttpClient cliente = await Detalle.getConection(); await cliente.DeleteAsync(Detalle.url + "/" + id); var servicioM = DependencyService.Get <InterfazMensaje>().GetMensaje("Contacto eliminado"); Detalle.ConvertirTextoAVoz(servicioM); await DisplayAlert("Mensaje Dependency", servicioM, "Ok"); }
public async Task Update(string id, string firstname, string lastname, string phoneNumber, string email) { ContactoAPI contact = new ContactoAPI() { Id = id, firstname = firstname, lastname = lastname, phoneNumber = phoneNumber, email = email }; System.Diagnostics.Debug.Write(id + " HOLA MUNDO"); HttpClient cliente = await Detalle.getConection(); await cliente.PutAsync(Detalle.url + "/" + id, new StringContent(JsonConvert.SerializeObject(contact), Encoding.UTF8, "application/json")); }
public async Task <ContactoAPI> Post(string id, string firstname, string lastname, string phoneNumber, string email) { ContactoAPI contact = new ContactoAPI() { Id = "", firstname = firstname, lastname = lastname, phoneNumber = phoneNumber, email = email }; HttpClient cliente = await Detalle.getConection(); var response = await cliente.PostAsync(Detalle.url, new StringContent(JsonConvert.SerializeObject(contact), Encoding.UTF8, "application/json")); return(JsonConvert.DeserializeObject <ContactoAPI>(await response.Content.ReadAsStringAsync())); }