I've got a route defined in the WebApiConfig:
config.Routes.MapHttpRoute(name: "dav", routeTemplate: "api/values/{*file}", defaults: new { controller = "Values", action = "Get" }); The {*file} part of the route template defines that the number of parameters are variable. This is documentented on MSDN.
Got a controller with action Get:
[AcceptVerbs("GET")] [ActionName("Get")] public HttpResponseMessage Get(param string[] file) {} When run the uri http://[mymachine]/api/values/1/1/2/3/ hits the method Get. Only the file array is empty.
Also tried the usual like:
public HttpResponseMessage Get(string[] file) And
public HttpResponseMessage Get(string file) Both end in a 404.
Any ideas?
FromUriattribute to thefileparameter for any of those combinations?