I need to map an HttpRoute (in Asp.Net Web API) where the incoming URL has '.' character.
config.Routes.MapHttpRoute
(
name: "ReturnPushPackageRule",
routeTemplate: "v1/pushPackages/web.com.example.test",
defaults: new
{
controller = "Values",
action = "ReturnWebsitePackage"
}
);
I have the definition for the action like the following:
public class ValuesController : ApiController
{
[HttpPost]
[HttpGet]
public HttpResponseMessage ReturnWebsitePackage()
{
.....
}
}
but I get a Method not found exception when I hit the URL. I suspect it is because of the URL having '.' char. Has anyone else comes across this and knows how to resolve?
Thanks!