public RouteMatchData Match(IHttpContext httpContext) { if (false == DoesHttpMethodMatch(httpContext)) { return(null); } Match match = urlScheme.Match(httpContext.RequestPath); if (false == match.Success) { return(null); } if (log.IsDebugEnabled) { log.DebugFormat( "Matched request path '{1}' to URL scheme '{0}'", urlScheme, httpContext.RequestPath); } RouteMatchData data = new RouteMatchData(); for (int i = 0; i < match.Groups.Count; i++) { string groupName = urlScheme.GroupNameFromNumber(i); data.AddParameter(groupName, match.Groups[i].Value); } return(data); }
public void Initialize( IHttpContext httpContext, RouteMatchData routeMatchData) { this.httpContext = httpContext; this.routeMatchData = routeMatchData; }
public RouteMatchData Match(IHttpContext httpContext) { if (false == DoesHttpMethodMatch(httpContext)) return null; Match match = urlScheme.Match(httpContext.RequestPath); if (false == match.Success) return null; if (log.IsDebugEnabled) log.DebugFormat( "Matched request path '{1}' to URL scheme '{0}'", urlScheme, httpContext.RequestPath); RouteMatchData data = new RouteMatchData(); for (int i = 0; i < match.Groups.Count; i++) { string groupName = urlScheme.GroupNameFromNumber(i); data.AddParameter(groupName, match.Groups[i].Value); } return data; }
private static IHttpResponse ListPackages(IHttpContext context, RouteMatchData routeMatchData) { return LiteralHttpResponse.FormatHttpResponse( HttpStatusCode.OK, HttpConstants.ContentTypeText, "list"); }
private static IHttpResponse GetPackage(IHttpContext context, RouteMatchData routeMatchData) { return LiteralHttpResponse.FormatHttpResponse( HttpStatusCode.OK, HttpConstants.ContentTypeText, "get{0}", routeMatchData.GetParameter("id")); }
public IHttpResponse Handle(IHttpContext context, RouteMatchData routeMatchData) { return handlerFunc(context, routeMatchData); }
public IHttpResponse Handle(IHttpContext context, RouteMatchData routeMatchData) { return(handlerFunc(context, routeMatchData)); }