web api routing and http post [duplicate]
This question already has an answer here: WebAPI - Attribute Routing POST not working with WebAPI Cors? 1 answer I'm building an API using WEB API 2. I have the following API controller: [RoutePrefix("api/account")] public class AccountController : ApiController { [Route("login")] [HttpPost] public IHttpActionResult AuthenticateUser(string username, string password) { if (string.IsNullOrEmpty(username) || string.IsNullOrEmpty(password)) { return BadRequest("You must submit username and password"); } if (!Membership.ValidateUser(username, password)) { return BadRequest("Incorrect username or