Esempio n. 1
0
        public async void Editar(DatosAlumnos a)
        {
            var json   = JsonConvert.SerializeObject(a);
            var result = await cliente.PutAsync("practica4/Alumnos", new StringContent(json, Encoding.UTF8, "application/json"));

            result.EnsureSuccessStatusCode();
        }
Esempio n. 2
0
        public async void Eliminar(DatosAlumnos a)
        {
            var json = JsonConvert.SerializeObject(a);
            HttpRequestMessage message = new HttpRequestMessage(HttpMethod.Delete, "practica4/Alumnos");

            message.Content = new StringContent(json, Encoding.UTF8, "application/json");
            var result = await cliente.SendAsync(message);

            result.EnsureSuccessStatusCode();
        }