Ejemplo n.º 1
0
        public ActionResult Ask(string question)
        {
            Response.AppendHeader("Access-Control-Allow-Origin", "*");
            WebNewsReader reader  = new WebNewsReader();
            var           results = reader.SearchTitle(question);

            return(new JsonResult {
                Data = results, JsonRequestBehavior = JsonRequestBehavior.AllowGet, ContentType = "application/json"
            });
        }
Ejemplo n.º 2
0
        public ActionResult Headers(string category)
        {
            Response.AppendHeader("Access-Control-Allow-Origin", "*");
            WebNewsReader reader  = new WebNewsReader();
            var           results = reader.GetTitles(category, 5);

            return(new JsonResult {
                Data = results, JsonRequestBehavior = JsonRequestBehavior.AllowGet, ContentType = "application/json"
            });
        }