public static bool EditarVotacion(Votaciones votacion) { using (var cliente = new HttpClient()) { cliente.BaseAddress = new Uri(urlBWA); var putTask = cliente.PutAsJsonAsync($"api/votaciones/{votacion.Id}", votacion); putTask.Wait(); var result = putTask.Result; return(result.IsSuccessStatusCode); } }
public static bool CrearVotacion(Votaciones votacion) { using (var cliente = new HttpClient()) { cliente.BaseAddress = new Uri(urlBWA); var postTask = cliente.PostAsJsonAsync <Votaciones>("api/votaciones", votacion); postTask.Wait(); var result = postTask.Result; return(result.IsSuccessStatusCode); } }