简体   繁体   中英

IIS 7, MVC2 Web Service, HTTP 405 Error on PUT

This is a similar question as IIS 7.5, Web Service and HTTP 405 error but a little different. Instead of a WCF web service, I've got an MVC2 web service that returns a 405 error when a PUT is used in the request. And, in my case, POST works just fine.

I'm guessing I need to either add or tweak an IIS 7 Handler Mapping to get PUT to work but my hosting provider hasn't been much help. Anyone out there run into this and know how to get PUTs to work in an MVC2 web service running in IIS 7? My apologies if this has already been answered, I've been searching all day and haven't found the magical answer.

Any help would be greatly appreciated...

我们遇到了同样的问题,解决方案是在Web.config文件的section中添加一个元素:

<remove name="WebDAVModule"/>

Have a look at https://serverfault.com/questions/93424/how-to-enable-put-and-delete-in-iis7/93428#93428

dario-solera:

You can take a look at the "Handlers Mappings" sections at either the server or site level (IIS group). Select a mapping for an extension (eg .aspx) and select "Edit" from the context menu. The "Verbs" tab allows you to specify verbs to accept.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM