I'm having issues navigating to my ListPeople method using the URL. If I type localhost:12345/People?peopleId=405&age=24 into my URL it works fine; however, when I pass localhost:12345/People?peopleId=405 into my URL, it returns a 404 error.
404 Error Message:
"No HTTP resource was found that matches the request URI'http://localhost:12345/People?peopleId=405'."
How can I change the routing of my ListPeople controller so that it excepts BOTH url's?
Controller
[HttpGet]
[ReturnDescription("List of People")]
[CustomActionName("")]
[Description("List of people for given peopleId and age")]
public ApiResponse<Status, IEnumerable<People>> ListPeople(int peopleId, int? age)
{
return _personProject.ListPeople(peopleId, age);
}
Successful URL
localhost:12345/People?peopleId=405&age=24
Failing URL
localhost:12345/People?peopleId=405