ApiHandlers
Add a new API Handler at a custom route.
RawHttpHandlers.Add(ApiHandlers.Json("/api/{Request}")) => delegates /api/* requests to JSON Request Handler, e.g:
- /api/Hello => {"result":"Hello"}
- /api/Hello?name=World => {"result":"Hello, World"}
Assembly: ServiceStack.dll
View Source
Declaration
public static class ApiHandlers
Methods
Json(String)
View Source
Declaration
public static Func<IHttpRequest, HttpAsyncTaskHandler> Json(string apiPath)
Returns
System.Func<ServiceStack.Web.IHttpRequest,ServiceStack.Host.Handlers.HttpAsyncTaskHandler>
Parameters
Type | Name |
---|---|
System.String | apiPath |
Jsv(String)
View Source
Declaration
public static Func<IHttpRequest, HttpAsyncTaskHandler> Jsv(string apiPath)
Returns
System.Func<ServiceStack.Web.IHttpRequest,ServiceStack.Host.Handlers.HttpAsyncTaskHandler>
Parameters
Type | Name |
---|---|
System.String | apiPath |
Csv(String)
View Source
Declaration
public static Func<IHttpRequest, HttpAsyncTaskHandler> Csv(string apiPath)
Returns
System.Func<ServiceStack.Web.IHttpRequest,ServiceStack.Host.Handlers.HttpAsyncTaskHandler>
Parameters
Type | Name |
---|---|
System.String | apiPath |
Xml(String)
View Source
Declaration
public static Func<IHttpRequest, HttpAsyncTaskHandler> Xml(string apiPath)
Returns
System.Func<ServiceStack.Web.IHttpRequest,ServiceStack.Host.Handlers.HttpAsyncTaskHandler>
Parameters
Type | Name |
---|---|
System.String | apiPath |
Generic(String, String, RequestAttributes, Feature)
View Source
Declaration
public static Func<IHttpRequest, HttpAsyncTaskHandler> Generic(string apiPath, string contentType, RequestAttributes requestAttributes, Feature feature)
Returns
System.Func<ServiceStack.Web.IHttpRequest,ServiceStack.Host.Handlers.HttpAsyncTaskHandler>
Parameters
Type | Name |
---|---|
System.String | apiPath |
System.String | contentType |
ServiceStack.RequestAttributes | requestAttributes |
ServiceStack.Feature | feature |