Sisk

Class

Route

Namespace
Sisk.Core.Routing
Assembly
Sisk.Core.dll

Represents an HTTP route to be matched by an Router.

C#
public class Route

Inheritance #

object ← Route

Derived #

RegexRoute

Inherited Members #

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors #

NameDescription
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 #

NameDescription
AnyPathRepresents an route path which captures any URL path.

Properties #

NameDescription
ActionGets or sets the function that is called after the route is matched with the request.
AllowRewritesGets whether the router can rewrite this route path, such as prepending the router prefix or redirecting requests to the trailing-slash path.
BagGets or sets an TypedValueDictionary for this route, which can hold contextual variables for this Route object.
BypassGlobalRequestHandlersGets or sets the global request handlers instances that will not run on this route.
IsAsyncGets an boolean indicating if this Route action return is an asynchronous Task.
LogModeGets or sets how this route can write messages to log files on the server.
MethodGets or sets the matching HTTP method.
NameGets or sets the route name.
PathGets or sets the path expression that will be interpreted by the router and validated by the requests.
RequestHandlersGets or sets the request handlers instances to run before the route action.
UseCorsGets or sets whether this route should send Cross-Origin Resource Sharing headers in the response.
UseRegexGets if this route is interpreted as an regular expression. This property is kept for compatibility and is only true for RegexRoute instances.

Methods #

NameDescription
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.

Type to search the documentation and the API reference.