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; }
private void InvokeHandlerAction(HttpRequestDispatcherAction handler, HttpContext context) { try { handler.Handler(context); } catch (BadRequestException) { context.Response.StatusCode = HttpStatusCode.BadRequest; } }
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); }