public HttpResponseMessage ObtenerNoticias() { HttpResponseMessage response = new HttpResponseMessage(HttpStatusCode.OK); ResponseConfig config = VerifyAuthorization(Request.Headers); RestResponse data = new RestResponse(); try { VerifyMessage(config.errorMessage); using (NewService service = new NewService()) { var Noticias = service.TodasLasNoticias(); data.result = new { Noticias }; data.status = true; } } catch (Exception ex) { response.StatusCode = config.isAuthenticated ? HttpStatusCode.BadRequest : HttpStatusCode.Unauthorized; data.status = false; data.message = ex.Message; data.error = NewError(ex, "Lista de Noticias"); } finally { response.Content = CreateContent(data); } return(response); }