ASP.NET:重写IIS响应"预计100 QUOT;头? [英] ASP.NET: Overriding IIS response to "expect 100" header?

查看:98
本文介绍了ASP.NET:重写IIS响应"预计100 QUOT;头?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个接收来自客户端软件的要求和请求头包含要求100-继续的ASP.NET应用程序。

I have an ASP.NET application that receives requests from a client software and the request headers contain a "request 100-continue".

我要重写IIS自动回复的要求,100头,这样我可以用其他的标题来验证用户(或没有),并根据不同的状态(100持续明显认证)或发送一个正确的响应正确的错误消息。

I want to override IIS auto-response to request-100 header so that I can use the other headers to authenticate the user (or not) and send a proper response depending on the state (100 continue for authenticated obviously) or a proper error message.

推荐答案

我们已经完成了这种类型的事情的方式,我相信一个常用的方法是创建一个HTTP模块 - 模块被称为上就是做每个请求您的应用程序的请求管道的一部分,在整个申请进入生命周期事件。您可以检查每个请求,并采取措施,如进行身份验证,并改变基于请求头。他们还让你检查传出响应并修改它。

The way we have accomplished this type of thing, and I believe a common approach is to create an HTTP Module - Modules are called on every request that is made to your app as part of the request pipeline and has access to life-cycle events throughout the request. You can examine each requests and take action such as performing your authentication, and changing the headers based on the request. They also let you examine the outgoing response and modify it.

注意从 http://msdn.microsoft.com/en-us/库/ bb398986.aspx 如果你是新的模块,一个巨大的资源。

Notes From http://msdn.microsoft.com/en-us/library/bb398986.aspx a great resource if you are new to modules.

希望这有助于!

这篇关于ASP.NET:重写IIS响应"预计100 QUOT;头?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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