Table of Contents

Interface IHttpRoute

Namespace
System.Web.Http.Routing
Assembly
System.Web.Http.dll

IHttpRoute defines the interface for a route expressing how to map an incoming HttpRequestMessage to a particular controller and action.

public interface IHttpRoute

Properties

Constraints

Gets the constraints for the route parameters.

IDictionary<string, object> Constraints { get; }

Property Value

IDictionary<string, object>

The constraints for the route parameters.

DataTokens

Gets any additional data tokens not used directly to determine whether a route matches an incoming HttpRequestMessage.

IDictionary<string, object> DataTokens { get; }

Property Value

IDictionary<string, object>

The additional data tokens.

Defaults

Gets the default values for route parameters if not provided by the incoming HttpRequestMessage.

IDictionary<string, object> Defaults { get; }

Property Value

IDictionary<string, object>

The default values for route parameters.

Handler

Gets the message handler that will be the recipient of the request.

HttpMessageHandler Handler { get; }

Property Value

HttpMessageHandler

The message handler.

RouteTemplate

Gets the route template describing the URI pattern to match against.

string RouteTemplate { get; }

Property Value

string

The route template.

Methods

GetRouteData(string, HttpRequestMessage)

Determine whether this route is a match for the incoming request by looking up the <see cref="!:IRouteData" /> for the route.

IHttpRouteData GetRouteData(string virtualPathRoot, HttpRequestMessage request)

Parameters

virtualPathRoot string

The virtual path root.

request HttpRequestMessage

The request.

Returns

IHttpRouteData

The <see cref="!:RouteData" /> for a route if matches; otherwise null.

GetVirtualPath(HttpRequestMessage, IDictionary<string, object>)

Gets a virtual path data based on the route and the values provided.

IHttpVirtualPathData GetVirtualPath(HttpRequestMessage request, IDictionary<string, object> values)

Parameters

request HttpRequestMessage

The request message.

values IDictionary<string, object>

The values.

Returns

IHttpVirtualPathData

The virtual path data.