Possible Duplicate:
ASP.NET Web API returns 404 for PUT only on some servers
I have created a new ASP.Net MVC4 solution to use the new Web API functionality. I have a controller inheriting from ApiController and I am using the AttributeRouting project (perhaps best explained here) to set up my routes.
I have set up the following method for POST:
[POST("bank/{id}")]
public void Post(int id, BankRequest bank)
{
// Create a new Bank here
}
When calling this from Fiddler I can debug this in Visual Studio 2012 and see that everything works as expected. I can see the id is correct and that the json is automatically serialized correctly into my BankRequest object. All very nice, I think. GET also works as expected.
Then I have a similar method for PUT:
[PUT("bank/{id}")]
public void Put(int id, BankRequest bank)
{
// Update a Bank here
}
The problem is that I get a HTTP 404 Not Found message when calling this. All I do is send exactly the same url and json in, just changing from POST to PUT. All I do in Fiddler is change from POST to PUT, so my url and json are preserved. When I switch back to POST it works fine as well. I don't know if it is the fancy AttributeRouting that does not work or if something else is incorrect.
Does anyone know why?
Please note that I am setting up an API defined by others, so I have to support PUT.