iis html post,iis - Enabling POST requests for html files in IIS7 - Server Fault

Problem

There have been quite a few other questions about this (in particular, the 405 Method Not Allowed error), but I've yet to find a solution that seems to work.

I have a web application in html and javascript only (no backend) and the javascript uses POST in forms. I understand that IIS sees html files as static and only allows them to use GET and HEAD verbs, so when a form is posted I'm getting "405 Method Not Allowed...cannot be displayed because an invalid method (HTTP verb) is being used".

Configuration

I have a default installation of IIS 7 on a Win 7 machine. By default ISAPI/CGI/ASP etc, and WebDav are all disabled/not installed. The only setting I've changed is added read/write for some of the features under Feature Delegation.

Under Handler Mappings on the Default Site I have OPTIONSVerbHandler, TRACEVerbHandler and StaticFile. The StaticFile request restrictions shows all verbs enabled, access read, invoke handler only if request is mapped to file or folder.

System.Web.DefaultHttpHandler properties show the verbs GET, HEAD and POST.

Tried so far

If I set up another Handler Mapping, duplicating OPTIONS but setting ther verb to POST instead, the 405 error is gone, but I get a blank page instead.

As suggested near the bottom of this question, I tried adding this to my web.config, but it didn't seem to have any effect:

(I also did the same with the config GUI, and also added HttpPostLocalhost.)

I've tried changing post to POST in the html (just in case), but that had no effect.

I've also tried explicitly allowing the verbs under Request Filtering, but that didn't help either.

Does anyone have any other ideas? I assume it will work if I install asp and change all of my file extensions, but that seems unnecessary.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值