示例#1
0
        public HttpResponseMessage Get(string src, string dest, int y, int m, int d, int tickets)
        {
            DatabaseHandler dh       = new DatabaseHandler(configFilePath);
            QueryDispatcher qd       = new QueryDispatcher(dh, configFilePath);
            string          flights  = qd.SearchFlights(src, dest, new DateTime(y, m, d), tickets);
            var             response = this.Request.CreateResponse(HttpStatusCode.OK);

            response.Content = new StringContent(flights, Encoding.UTF8, "application/json");
            response.Headers.Add("Access-Control-Allow-Origin", "*");
            return(response);
        }