Class
Route
Represents an HTTP route to be matched by an Router.
public class RouteInheritance #
Derived #
Inherited Members #
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Constructors #
| Name | Description |
|---|---|
| Route(RouteMethod, string, Delegate?) | Creates an new Route instance with given parameters. |
| Route(RouteMethod, string, string?, Delegate?, IRequestHandler[]?) | Creates an new Route instance with given parameters. |
| Route() | Creates an new Route instance with no parameters. |
Fields #
| Name | Description |
|---|---|
| AnyPath | Represents an route path which captures any URL path. |
Properties #
| Name | Description |
|---|---|
| Action | Gets or sets the function that is called after the route is matched with the request. |
| AllowRewrites | Gets whether the router can rewrite this route path, such as prepending the router prefix or redirecting requests to the trailing-slash path. |
| Bag | Gets or sets an TypedValueDictionary for this route, which can hold contextual variables for this Route object. |
| BypassGlobalRequestHandlers | Gets or sets the global request handlers instances that will not run on this route. |
| IsAsync | Gets an boolean indicating if this Route action return is an asynchronous Task. |
| LogMode | Gets or sets how this route can write messages to log files on the server. |
| Method | Gets or sets the matching HTTP method. |
| Name | Gets or sets the route name. |
| Path | Gets or sets the path expression that will be interpreted by the router and validated by the requests. |
| RequestHandlers | Gets or sets the request handlers instances to run before the route action. |
| UseCors | Gets or sets whether this route should send Cross-Origin Resource Sharing headers in the response. |
| UseRegex | Gets if this route is interpreted as an regular expression. This property is kept for compatibility and is only true for RegexRoute instances. |
Methods #
| Name | Description |
|---|---|
| Any(string, Delegate?) | Creates a route that responds to any HTTP request method. |
| Any(string, RouteAction) | Creates a route that responds to any HTTP request method. |
| Delete(string, Delegate?) | Creates a route that responds to HTTP DELETE requests. |
| Delete(string, RouteAction) | Creates a route that responds to HTTP DELETE requests. |
| Get(string, Delegate?) | Creates a route that responds to HTTP GET requests. |
| Get(string, RouteAction) | Creates a route that responds to HTTP GET requests. |
| Head(string, Delegate?) | Creates a route that responds to HTTP HEAD requests. |
| Head(string, RouteAction) | Creates a route that responds to HTTP HEAD requests. |
| Match(string, Router) | Tests if the specified request path matches this route path. The HTTP method is validated by the Router after the path matches. |
| OnPathModified(string, string) | Called after the Path property is changed. |
| Options(string, Delegate?) | Creates a route that responds to HTTP OPTIONS requests. |
| Options(string, RouteAction) | Creates a route that responds to HTTP OPTIONS requests. |
| Patch(string, Delegate?) | Creates a route that responds to HTTP PATCH requests. |
| Patch(string, RouteAction) | Creates a route that responds to HTTP PATCH requests. |
| Post(string, Delegate?) | Creates a route that responds to HTTP POST requests. |
| Post(string, RouteAction) | Creates a route that responds to HTTP POST requests. |
| Put(string, Delegate?) | Creates a route that responds to HTTP PUT requests. |
| Put(string, RouteAction) | Creates a route that responds to HTTP PUT requests. |
| Query(string, Delegate?) | Creates a route that responds to HTTP QUERY requests. |
| Query(string, RouteAction) | Creates a route that responds to HTTP QUERY requests. |
| ToString() | Gets an string notation for this Route object. |