The requested URL: http://localhost/api/access/blob
The route:
config.Routes.MapHttpRoute(
name: "AccessApi",
routeTemplate: "api/{controller}/{action}"
);
The defined actions:
public class AccessController : ApiController
{
// GET api/access/blob
[HttpGet]
public string Blob()
{
return "blob shared access signature";
}
// GET api/access/queue
[HttpGet]
public string Queue()
{
return "queue shared access signature";
}
}
The result:
Multiple actions were found that match the request:
System.String Blob() on type Project.Controllers.AccessController
System.String Queue() on type Project.Controllers.AccessController
Why isn’t it finding the appropriate action?
You have to remove the
DefaultApiroute configuration on the WebApiConfig.cs file. Add just your configuration:And it will work with the url:
http://localhost/api/access/blobhttp://localhost/api/access/queue