示例#1
0
 public HttpListenerResponse HandleRequest(HttpListenerRequest request, HttpListenerResponse response)
 {
     try
     {
         var route = routeResolver.ResolveRoute(request.Url.AbsolutePath, request.HttpMethod);
         this.DispatchRequest(route, request, response);
     }
     catch (RoutingException e)
     {
         response.StatusCode = 500;
         WriteToResponse(response, e.Message);
     }
     return(response);
 }
示例#2
0
 public void ResolveCommand(string uri, string method = "GET")
 {
     Util.WriteLine(routeResolver.ResolveRoute(uri, method.ToUpper()));
 }