John Baird John Baird - 2 months ago 10x
ASP.NET (C#) Question

Webapi 2 Attribute Routing

I have the following routes set up in a user controller:

[EnableCors("*", "*", "*")]
public class UserController : ApiController
public IHttpActionResult Get()

public IHttpActionResult Get(int id)

public IHttpActionResult ValidateUser()

public void VerifyUserEmailAddress(string identityId, string emailAddress)

The first three routes work just fine. But the fourth fails with a 404. I'm using fiddler to make the call:

http://localhost:39897/api/users/verify/asldkfj/ (post is selected)

Does post require data sent in the body? Can anyone see what I'm doing wrong and why the verify route is not being found?


The .com in the email is the issue.

Sure its a valid email, but IIS treats requests with file extensions as actual file requests and tries to find it on disk. When it can't find it then you get the 404 Not Found

If you add a trailing slash / to the request it should work.

ie http://localhost:39897/api/users/verify/asldkfj/