[英]How do I read response headers in a .NET 4.0 app running on IIS6?
I am writing a custom IHttpModule implementor so I can log request/response information as required. 我正在编写一个自定义IHttpModule实现器,因此可以根据需要记录请求/响应信息。 However I've hit a stumbling block when attempting to read the response headers. 但是,在尝试读取响应标头时遇到了绊脚石。 HttpResponse.Headers is now only supported if you are running on IIS7 and in integrated pipeline mode. 现在,只有在IIS7上并以集成管道模式运行时,才支持HttpResponse.Headers。 I need this module to be installed in web applications hosted under IIS6, so I need an alternative way to get this information. 我需要将此模块安装在IIS6下托管的Web应用程序中,因此我需要一种替代方法来获取此信息。
What is the best way to achieve this? 实现此目标的最佳方法是什么?
Why do you as the server need to read them? 为什么您作为服务器需要阅读它们?
I recall being able to write them as far back as IIS 5 in the Page.Load event handler. 我记得可以在Page.Load事件处理程序中将它们写回到IIS 5。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.