I am currently working on a Web API that must return a list of servers or a single server if the FQDN is passed to the API.
The route is:
"api/Servers/{fqdn}"
When I perform a GET from a REST Client on a URL like this:
GET api/Servers/hostname.domain.com
IIS returns a 404 Not Found.
When I perform a GET without a "." in the URL parameter:
GET api/Servers/hostname_domain_com
It gets routed successfully to my API controller.
When I get the 404 error page, it is the IIS 8 error page. This leads me to believe that when there is a "." in the URL that IIS does not even pass it to the MVC pipeline and non of my code is executed. Could it be because IIS is trying to find another handler for the request as it looks like I am requesting a ".com" file extension. But this is just my assumption.
Has anyone experienced this before and if so how did you get around it?