Web API route to action name
问题 I need a controller to return JSON to be consumed by JavaScript so I inherited from the ApiController class but it isn't behaving as I expected. The Apress book Pro ASP.NET MVC 4 and most of the online examples I've found give examples like: public class ServicesController : ApiController { public string[] MethodFruit() { return new string[] { "Apple", "Orange", "Banana" }; } accessed via the URL: http://mysite/services/methodfruit But that never works - the resource isn't found. The only