Partager via


HttpRoute.GetRouteData Method

Determines whether this route is a match for the incoming request by looking up the HttpRouteData for the route.

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

Syntax

'Declaration
Public Overridable Function GetRouteData ( _
    virtualPathRoot As String, _
    request As HttpRequestMessage _
) As IHttpRouteData
'Usage
Dim instance As HttpRoute
Dim virtualPathRoot As String
Dim request As HttpRequestMessage
Dim returnValue As IHttpRouteData

returnValue = instance.GetRouteData(virtualPathRoot, _
    request)
public virtual IHttpRouteData GetRouteData(
    string virtualPathRoot,
    HttpRequestMessage request
)
public:
virtual IHttpRouteData^ GetRouteData(
    String^ virtualPathRoot, 
    HttpRequestMessage^ request
)
abstract GetRouteData : 
        virtualPathRoot:string * 
        request:HttpRequestMessage -> IHttpRouteData 
override GetRouteData : 
        virtualPathRoot:string * 
        request:HttpRequestMessage -> IHttpRouteData 
public function GetRouteData(
    virtualPathRoot : String, 
    request : HttpRequestMessage
) : IHttpRouteData

Parameters

  • request
    Type: HttpRequestMessage
    The HTTP request.

Return Value

Type: System.Web.Http.Routing.IHttpRouteData
The HttpRouteData for a route if matches; otherwise null.

Implements

IHttpRoute.GetRouteData(String, HttpRequestMessage)

See Also

Reference

HttpRoute Class

System.Web.Http.Routing Namespace