Rest not allowing PUT in IIS 8.5 : error 405

扶醉桌前 提交于 2019-12-11 11:33:11

问题


I have a restfull web service in .Net. When we tested the PUT in a PC with windows 7 and IIS 7 it works fine.

When we tested the web service in a PC with windows 8 and IIS 8.5 we get a 405 status code. This is the result from Fiddler

Edit This is the applicationHost.config part regarding ExtensionlessUrlHandler-Integrated. I don't have an ExtensionlessUrl-Integrated

I assume this is a IIS issue, anyone knows how to solve this? Thanks in advance


回答1:


You have to add the PUT verb in your ExtensionlessUrl-Integrated-4.0 list. Make the following change your applicationhost.config file for your IIS instance.

<add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,PUT,OPTIONS,TRACE" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />

You will also want to add any other verbs you might be allowing like DELETE.

See: ASP.NET Web API - PUT & DELETE Verbs Not Allowed - IIS 8



来源:https://stackoverflow.com/questions/33835088/rest-not-allowing-put-in-iis-8-5-error-405

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