RestPath
Assembly: ServiceStack.dll
View Source
public class RestPath : IRestPath
Properties
IsWildCardPath
View Source
public bool IsWildCardPath { get; }
VariableArgsCount
View Source
public int VariableArgsCount { get; set; }
PathComponentsCount
The number of segments separated by '/' determinable by path.Split('/').Length e.g. /path/to/here.ext == 3
View Source
public int PathComponentsCount { get; set; }
TotalComponentsCount
The total number of segments after subparts have been exploded ('.') e.g. /path/to/here.ext == 4
View Source
public int TotalComponentsCount { get; set; }
Verbs
View Source
public string[] Verbs { get; }
RequestType
View Source
public Type RequestType { get; }
Path
View Source
public string Path { get; }
Summary
View Source
public string Summary { get; set; }
Notes
View Source
public string Notes { get; set; }
MatchRule
View Source
public string MatchRule { get; }
AllowsAllVerbs
View Source
public bool AllowsAllVerbs { get; }
AllowedVerbs
View Source
public string AllowedVerbs { get; }
Priority
View Source
public int Priority { get; set; }
IsValid
View Source
public bool IsValid { get; set; }
FirstMatchHashKey
Provide for quick lookups based on hashes that can be determined from a request url
View Source
public string FirstMatchHashKey { get; }
UniqueMatchHashKey
View Source
public string UniqueMatchHashKey { get; }
CalculateMatchScore
View Source
public static Func<RestPath, string, string[], int> CalculateMatchScore { get; set; }
Methods
GetPathPartsForMatching(String)
View Source
public static string[] GetPathPartsForMatching(string pathInfo)
Returns
System.String[]
Parameters
Type | Name |
---|---|
System.String | pathInfo |
GetFirstMatchHashKeys(String[])
View Source
public static IEnumerable<string> GetFirstMatchHashKeys(string[] pathPartsForMatching)
Returns
System.Collections.Generic.IEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String[] | pathPartsForMatching |
GetFirstMatchWildCardHashKeys(String[])
View Source
public static IEnumerable<string> GetFirstMatchWildCardHashKeys(string[] pathPartsForMatching)
Returns
System.Collections.Generic.IEnumerable<System.String>
Parameters
Type | Name |
---|---|
System.String[] | pathPartsForMatching |
ToRestRoute()
View Source
public RestRoute ToRestRoute()
Returns
MatchScore(String, String[])
View Source
public int MatchScore(string httpMethod, string[] withPathInfoParts)
Returns
System.Int32
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String[] | withPathInfoParts |
IsMatch(IHttpRequest)
For performance withPathInfoParts should already be a lower case string to minimize redundant matching operations.
View Source
public bool IsMatch(IHttpRequest httpReq)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
ServiceStack.Web.IHttpRequest | httpReq |
AfterInit()
View Source
public void AfterInit()
GetRequestRule()
View Source
public Func<IHttpRequest, bool> GetRequestRule()
Returns
System.Func<ServiceStack.Web.IHttpRequest,System.Boolean>
IsMatch(String, String[], out Int32)
For performance withPathInfoParts should already be a lower case string to minimize redundant matching operations.
View Source
public bool IsMatch(string httpMethod, string[] withPathInfoParts, out int wildcardMatchCount)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | httpMethod |
System.String[] | withPathInfoParts |
System.Int32 | wildcardMatchCount |
CreateRequest(String)
View Source
public object CreateRequest(string pathInfo)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | pathInfo |
CreateRequest(String, Dictionary<String, String>, Object)
View Source
public object CreateRequest(string pathInfo, Dictionary<string, string> queryStringAndFormData, object fromInstance)
Returns
System.Object
Parameters
Type | Name |
---|---|
System.String | pathInfo |
System.Collections.Generic.Dictionary<System.String,System.String> | queryStringAndFormData |
System.Object | fromInstance |
IsVariable(String)
View Source
public bool IsVariable(string name)
Returns
System.Boolean
Parameters
Type | Name |
---|---|
System.String | name |
GetHashCode()
View Source
public override int GetHashCode()
Returns
System.Int32