在IIS 8.5中不允许PUT休息:错误405 [英] Rest not allowing PUT in IIS 8.5 : error 405

查看:435
本文介绍了在IIS 8.5中不允许PUT休息:错误405的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在.Net中有一个restfull Web服务。当我们在装有Windows 7和IIS 7的PC上测试PUT时,它工作正常。



当我们在装有Windows 8和IIS 8.5的PC上测试Web服务时,我们得到了405状态代码。这是Fiddler的结果





我认为这是一个IIS问题,谁知道如何解决这个问题?
提前致谢

解决方案

您必须在ExtensionlessUrl-Integrated-4.0列表中添加PUT动词。进行以下更改IIS实例的applicationhost.config文件。

 < add name =ExtensionlessUrl-Integrated-4.0 PATH = *。 verb =GET,HEAD,POST,PUT,OPTIONS,TRACEtype =System.Web.Handlers.TransferRequestHandlerpreCondition =integratedMode,runtimeVersionv4.0responseBufferLimit =0/> 

您还需要添加您可能允许的任何其他动词,例如DELETE。



请参阅: ASP.NET Web API - PUT&删除动词不允许 - IIS 8


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

解决方案

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

这篇关于在IIS 8.5中不允许PUT休息:错误405的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆