I am currently using serviceStack for creating REST based services which are hosted in a MVC web application.
So far ServiceStack has been amazing and I have achieved to get most of what I wanted to do working. All this works in IISExpress.
I have now moved over to IIS 7.5 and I get the 400 error that the "Handler for Request not found" when doing a PUT. GET works fine and on IISExpress both PUT and GET work.
On IISExpress this all worked.
Any ideas?
Some info about IIS + PUT/DELETE Verbs taken from the NancyFx WebFx ASP.NET documentation:
By default IIS 6 does not support PUT and DELETE verbs. To enable this, you need to add a wildcard mapping to the virtual directory of your Nancy application - read the "IIS6 Extension-less URLs" section in this document: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx
You might receive "405 Not allowed" pages while trying to make PUT/DELETE requests on IIS 7/7.5. One way to fix it is to remove the WebDAVModule in the web.config.
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="WebDAVModule" />
</modules>
</system.webserver>
Soft PUT / DELETE - Emulating HTTP Verbs
ServiceStack also supports the X-Http-Method-Override HTTP Header which will allow you to simulate a PUT or DELETE with a POST (and vice-versa).
来源:https://stackoverflow.com/questions/10282193/put-handler-not-found-with-servicestack-on-iis7-5