IServiceRoutes
Allow the registration of user-defined routes for services
Assembly: ServiceStack.Interfaces.dll
View Source
public interface IServiceRoutes
Methods
Add<TRequest>(String)
Maps the specified REST path to the specified request DTO.
View Source
IServiceRoutes Add<TRequest>(string restPath)
Returns
ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance;
never null
.
Parameters
Type | Name | Description |
---|---|---|
System.String | restPath | The path to map the request DTO to. |
See ``ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path``
for details on the correct format.
|
Type Parameters
Name | Description |
---|---|
TRequest | The type of request DTO to map |
the path to. |
Add<TRequest>(String, String)
Maps the specified REST path to the specified request DTO, and specifies the HTTP verbs supported by the path.
View Source
IServiceRoutes Add<TRequest>(string restPath, string verbs)
Returns
ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance;
never null
.
Parameters
Type | Name | Description |
---|---|---|
System.String | restPath | The path to map the request DTO to. |
See ``ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path``
for details on the correct format.
|
| System.String
| verbs |
The comma-delimited list of HTTP verbs supported by the path,
such as "GET,PUT,DELETE". Specify empty or null
to indicate that all verbs are supported.
|
Type Parameters
Name | Description |
---|---|
TRequest | The type of request DTO to map |
the path to. |
Add(Type, String, String)
Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.
View Source
IServiceRoutes Add(Type requestType, string restPath, string verbs)
Returns
ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance;
never null
.
Parameters
Type | Name | Description |
---|---|---|
System.Type | requestType |
The type of request DTO to map the path to.
|
| System.String
| restPath | The path to map the request DTO to.
See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path
for details on the correct format.
|
| System.String
| verbs |
The comma-delimited list of HTTP verbs supported by the path,
such as "GET,PUT,DELETE".
|
Add(Type, String, String, Int32)
Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.
View Source
IServiceRoutes Add(Type requestType, string restPath, string verbs, int priority)
Returns
ServiceStack.Web.IServiceRoutes
Parameters
Type | Name | Description |
---|---|---|
System.Type | requestType | |
System.String | restPath | |
System.String | verbs | |
System.Int32 | priority |
Used to rank the precedences of route definitions in reverse routing. i.e. Priorities below 0 are auto-generated have less precedence.
|
Add(Type, String, String, String, String)
Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.
View Source
IServiceRoutes Add(Type requestType, string restPath, string verbs, string summary, string notes)
Returns
ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance;
never null
.
Parameters
Type | Name | Description |
---|---|---|
System.Type | requestType |
The type of request DTO to map the path to.
|
| System.String
| restPath | The path to map the request DTO to.
See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path
for details on the correct format.
|
| System.String
| verbs |
The comma-delimited list of HTTP verbs supported by the path,
such as "GET,PUT,DELETE".
|
| System.String
| summary |
The short summary of what the REST does.
|
| System.String
| notes |
The longer text to explain the behaviour of the REST.
|
Add(Type, String, String, String, String, String)
Maps the specified REST path to the specified request DTO, specifies the HTTP verbs supported by the path, and indicates the default MIME type of the returned response.
View Source
IServiceRoutes Add(Type requestType, string restPath, string verbs, string summary, string notes, string matches)
Returns
ServiceStack.Web.IServiceRoutes: The same ServiceStack.Web.IServiceRoutes instance;
never null
.
Parameters
Type | Name | Description |
---|---|---|
System.Type | requestType |
The type of request DTO to map the path to.
|
| System.String
| restPath | The path to map the request DTO to.
See ServiceStack.RouteAttribute.Path?text=RouteAttribute.Path
for details on the correct format.
|
| System.String
| verbs |
The comma-delimited list of HTTP verbs supported by the path,
such as "GET,PUT,DELETE".
|
| System.String
| summary |
The short summary of what the REST does.
|
| System.String
| notes |
The longer text to explain the behaviour of the REST.
|
| System.String
| matches |
Must match rule defined in Config.RequestRules or Regex expression with format:
"{IHttpRequest.Field} =~ {pattern}", e.g "PathInfo =~ \/[0-9]+$"
|