3

Closed

Web Api route parameters containing periods return 404.

description

In ASP.NET Web Api, route parameters that contain periods are not matched.

Steps to reproduce:

In the default web api template update the Get (by id) method as below:
    public string Get(string id)
    {
        return id;
    }
A request to /api/values/foo returns "foo".

A request to /api/values/foo.bar returns a 404.
Closed Apr 5 at 8:47 PM by HongmeiG
Per my comment, it is not really related to Web API but related to System.Web.

comments

HongmeiG wrote Sep 22, 2012 at 1:06 AM

Have you tried to add the following configuration to see if this works?

<system.webserver>
<modules runAllManagedModulesForAllRequests="true">

tugberk wrote Sep 22, 2012 at 10:39 AM

@HongmeiG

I had the same problem before and applied the config that you supplied and it made it work. I know this is not a Web API's issue, it's the issue with the Web Server but RAMMFAR is not the optimum way of handling this. Do u know which individual module do we need to enable this?

HongmeiG wrote Apr 5 at 8:46 PM

After talking to some expert on System.Web, this is his response.

"RAMMFAR is the correct way of handling this. if all requests are destined for managed code anyway, e.g. no static file requests, then RAMMFAR has zero overhead."

Hope this helps.