In the examples I have seen so far for MVC4 WebApi the following URL
/api/products
maps to the following action in the Products controller
GetAllProducts
Is the “All” required? It would be more logical to just use
GetProducts
The reason this is confusing in my app is that /api/products accepts a “filter” object that returns a subset of products not “all” the products.
The “All” is not required. The only thing that matters is that the method name starts with “Get”. After that, the method parameters can also affect which action gets selected if there are parameters that come from the URI.
Try renaming the “GetAllProducts” method that’s working for you to “GetProducts” and it should work just fine if you don’t change anything else.