Partager via


HttpRoute Class

Represents a route class for self-host (i.e. hosted outside of ASP.NET).

Inheritance Hierarchy

System.Object
  System.Web.Http.Routing.HttpRoute

Namespace:  System.Web.Http.Routing
Assembly:  System.Web.Http (in System.Web.Http.dll)

Syntax

'Declaration
Public Class HttpRoute _
    Implements IHttpRoute
'Usage
Dim instance As HttpRoute
public class HttpRoute : IHttpRoute
public ref class HttpRoute : IHttpRoute
type HttpRoute =  
    class
        interface IHttpRoute
    end
public class HttpRoute implements IHttpRoute

The HttpRoute type exposes the following members.

Constructors

  Name Description
Public method HttpRoute() Initializes a new instance of the HttpRoute class.
Public method HttpRoute(String) Initializes a new instance of the HttpRoute class.
Public method HttpRoute(String, HttpRouteValueDictionary) Initializes a new instance of the HttpRoute class.
Public method HttpRoute(String, HttpRouteValueDictionary, HttpRouteValueDictionary) Initializes a new instance of the HttpRoute class.
Public method HttpRoute(String, HttpRouteValueDictionary, HttpRouteValueDictionary, HttpRouteValueDictionary) Initializes a new instance of the HttpRoute class.
Public method HttpRoute(String, HttpRouteValueDictionary, HttpRouteValueDictionary, HttpRouteValueDictionary, HttpMessageHandler) Initializes a new instance of the HttpRoute class.

Top

Properties

  Name Description
Public property Constraints Gets the constraints for the route parameters.
Public property DataTokens Gets any additional data tokens not used directly to determine whether a route matches an incoming HttpRequestMessage.
Public property Defaults Gets the default values for route parameters if not provided by the incoming HttpRequestMessage.
Public property Handler Gets or sets the http route handler.
Public property RouteTemplate Gets the route template describing the URI pattern to match against.

Top

Methods

  Name Description
Public method Equals (Inherited from Object.)
Protected method Finalize (Inherited from Object.)
Public method GetHashCode (Inherited from Object.)
Public method GetRouteData Determines whether this route is a match for the incoming request by looking up the HttpRouteData for the route.
Public method GetType (Inherited from Object.)
Public method GetVirtualPath Attempts to generate a URI that represents the values passed in based on current values from the HttpRouteData and new values using the specified HttpRoute.
Protected method MemberwiseClone (Inherited from Object.)
Protected method ProcessConstraint Determines whether this instance equals a specified route.
Public method ToString (Inherited from Object.)

Top

Remarks

This class is mostly the same as the Route implementation. This class has the same URL matching functionality as Route. However, in order for this route to match when generating URLs, a special "httproute" key must be specified when generating the URL.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Web.Http.Routing Namespace