Inheritance: IHttpRequestDispatcherAction
        public IHttpRequestDispatcherAction HandlePost(string uri)
        {
            if (uri == null) throw new ArgumentNullException(nameof(uri));

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

            return action;
        }
示例#2
0
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Handler(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }
示例#3
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);
        }
 private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context)
 {
     try
     {
         handler.Handler(context);
     }
     catch (BadRequestException)
     {
         context.Response.StatusCode = HttpStatusCode.BadRequest;
     }
 }