I am using the .Net MVC4 Web API to (hopefully) implement a RESTful api. I need to pass in a few parameters to the system and have it perform some action, then return a lis
Just add a new route to the WebApiConfig
entries.
For instance, to call:
public IEnumerable Get(int pageNumber, int pageSize) { ..
add:
config.Routes.MapHttpRoute(
name: "GetPagedData",
routeTemplate: "api/{controller}/{pageNumber}/{pageSize}"
);
Then add the parameters to the HTTP call:
GET ///Api/Data/2/10