I am trying to register a new route that handles the entry functions in the same way as for my other routes. Other routes worked, but only login does not.
Here is the route attribute for work routes :
[HttpPost]
[Route("api/user/adduser")]
public IHttpActionResult AddUser([FromBody]User user)
{
blah blah
}
Here is my code for the Login method:
[HttpPost]
[Route("api/user/login")]
public IHttpActionResult Login(String email, String password)
{
blah blah
}
And finally, here is my WebApiConfig.cs:
config.MapHttpAttributeRoutes();
config.Routes.MapHttpRoute(
name: "UserRouteApi",
routeTemplate: "api/user/{method}"
);
Here is what the http response is when I try to access login api ->
Output in browser:

I do not understand, I created the route in the same way as before. Tried to restart visual studio, iis express, sure my route pattern is correct.
I need desperate help here!
source
share