Rest not allowing PUT in IIS 8.5 : error 405

2019-08-08 08:34发布

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

enter image description here

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

enter image description here

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

1条回答
Rolldiameter
2楼-- · 2019-08-08 08:52

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

查看更多
登录 后发表回答