PUT handler not found with serviceStack on IIS7.5

狂风中的少年 提交于 2019-11-28 08:59:31

问题


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?


回答1:


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!