public HttpRequestDispatcherAction Handle(HttpMethod method, string uri)
        {
            if (uri == null) throw new ArgumentNullException(nameof(uri));

            var action = new HttpRequestDispatcherAction(method, uri);
            _handlers.Add(action);

            return action;
        }
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Action(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }
예제 #3
0
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Handler(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }
예제 #4
0
        public IHttpRequestDispatcherAction HandlePatch(string uri)
        {
            if (uri == null)
            {
                throw new ArgumentNullException(nameof(uri));
            }

            var action = new HttpRequestDispatcherAction(HttpMethod.Patch, uri);

            _handlers.Add(action);

            return(action);
        }