I am trying attributed routing with Web API 2. I have defined a route prefix and I have two methods. The first one works but the second one fails
[RoutePrefix("api/VolumeCap")]
public class VolumeCapController : ApiController
{
[Route("{id:int}")]
public IEnumerable<CustomType> Get(int id)
{
}
[Route("{id:int}/{parameter1:alpha}")]
public CustomType Get(int id, string parameter1)
{
}
}
http://localhost/MyWebAPI/api/VolumeCap/610023 //This works http://localhost/MyWebAPI/api/VolumeCap/610023?parameter1=SomeValue //This does not work
I get the following error
The requested resource does not support http method 'GET'.
I seem to be missing something obvious, but I am unable to figure out.