iis html post 405,IIS:405(方法不允许)发布默认页

我想POST表单数据到网络服务器的默认页面,当如:IIS:405(方法不允许)发布默认页

POST http://errorreporting.example.com/ HTTP/1.1

我希望服务器负责302将客户重定向到POST应该去的地方。该default.asp文件的服务器上执行此任务(which is the technique Microsoft recommends),通过执​​行Redirect:

的default.asp:

Response.Redirect "SubmitError.ashx"

%>

当我只是浏览服务器:

GET http://errorreporting.example.com/ HTTP/1.1

我收到服务器的预期响应:

HTTP/1.1 302 Object moved

Server: Microsoft-IIS/5.0

Location: SubmitError.ashx

...

但是,当我POST到服务器:

POST http://errorreporting.example.com/ HTTP/1.1

服务器变得非常暴躁跟我说:

HTTP/1.1 405 Method not allowed

Connection: close

Allow: OPTIONS, TRACE, GET, HEAD

...

我想服务器能够重定向客户到相应的提交URL,而不是用URL对客户端进行硬编码。这是当然的,因为URL可能(即拥有)改变:

http://errorreporting.example.com/SubmitError.asp

http://errorreporting.example.com/SubmitError.aspx

http://errorreporting.example.com/SubmitError.ashx

http://errorreporting.example.com/ErrorReporting/Submit.ashx

http://errorreporting.example.com/submiterror.php

http://errorreporting.example.com/submit/submiterror.ashx

注意:如果我改变URL包括文档位置:

/* SErrorReportingUrl = 'http://www.example.com:8088/ErrorReporting/SubmitError.ashx';

SErrorReportingUrl = 'http://www.example.com/ErrorReporting/SubmitError.ashx';

SErrorReportingUrl = 'http://errorreporting.example.com:8088/ErrorReporting/SubmitError.ashx';

SErrorReportingUrl = 'http://errorreporting.example.com/SubmitError.ashx';

SErrorReportingUrl = 'http://errorreporting.example.com';

SErrorReportingUrl = 'http://errorreporting.example.com/SubmitError.ashx';

*/

SErrorReportingUrl = 'http://errorreporting.example.com/submit/SubmitError.ashx';

它工作正常:

HTTP/1.1 200 OK

2010-06-25

Ian Boyd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值