public void Test1EliminarEspecialidad() { JavaScriptSerializer js = new JavaScriptSerializer(); Especialidad especialidadCrear = new Especialidad() { Codigo = "MICRO-12", }; string postdata = js.Serialize(especialidadCrear); byte[] data = Encoding.UTF8.GetBytes(postdata); HttpWebRequest request = (HttpWebRequest)WebRequest. Create("http://localhost:53139/Especialidades.svc/Especialidades/MICRO-12"); request.Method = "DELETE"; request.ContentLength = data.Length; request.ContentType = "application/json"; var requestStream = request.GetRequestStream(); requestStream.Write(data, 0, data.Length); var response = (HttpWebResponse)request.GetResponse(); StreamReader reader = new StreamReader(response.GetResponseStream()); string tramaJson = reader.ReadToEnd(); Especialidad especialidadCreada = js.Deserialize <Especialidad>(tramaJson); }