public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; if (String.IsNullOrEmpty(context.Request.QueryString["q"])) return; var svc = new SearchService(); var search = svc.GeSearchResult(context.Request.QueryString["q"].Trim()); var res = JsonConvert.SerializeObject(search); context.Response.Write(res); }
public void GetSearchResult() { var res = new SearchService().GeSearchResult("honda"); Console.WriteLine(JsonConvert.SerializeObject(res, Formatting.Indented)); }