In my WebApiConfig.cs file I have the following route defined: (it's the only route defined here)
config.Routes.MapHttpRoute(
name: "DefaultApi2",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new {id = RouteParameter.Optional}
);
The POST I'm making is to:
http://localhost:17138/api/Account/Login
My controller is this:
namespace WebAPI.Api
{
public class AccountController : ApiController
{
[HttpPost]
public HttpResponseMessage Login(string username,string password)
{...
The error I'm getting is:
{"Message":"NoHTTPresourcewasfoundthatmatchestherequestURI'http://localhost:17138/api/Account/Login'.","MessageDetail":"Noactionwasfoundonthecontroller'Account'thatmatchestherequest."}
and from Phil's program it looks like the route should work. Any thoughts?
