Esempio n. 1
0
        public HttpResponseMessage Get(string since, string until)
        {
            Helper.LogRequest(this.ControllerContext.Request, Helper.API3RequestType.GetTitleSinceUntil);

            //var queryVals = this.ControllerContext.Request.RequestUri.ParseQueryString();
            //var query = queryVals["q"];

            HttpResponseMessage msg    = null;
            IEnumerable <Title> titles = titlesService.GetSearchSince(since, until);

            if (titles.Count() > 0)
            {
                msg = this.ControllerContext.Request.CreateResponse(HttpStatusCode.OK, (IEnumerable <Title>)titles);
            }
            else
            {
                msg = this.ControllerContext.Request.CreateResponse(HttpStatusCode.NotFound);
            }

            msg.Headers.Add("Access-Control-Allow-Origin", "*");
            return(msg);
        }