我如何可以访问请求体中的IIS重写提供商? [英] How can I access the request body in an IIS rewrite provider?
问题描述
我已经写了使用<一个自定义重写提供href="http://www.iis.net/learn/extensions/url-rewrite-module/developing-a-custom-rewrite-provider-for-url-rewrite-module"相对=nofollow> IRewriteProvider
接口,并在IIS中安装它。它的工作,但我需要访问的请求的,以及该URL的内容。一个新闻组建议我应该能够访问 HttpContext.Current
,但在我的测试中它显示为空
I've written a custom rewrite provider using the IRewriteProvider
interface, and installed it in IIS. It's working, but I need to access the content of the request as well as the URL. A newsgroup posting suggests that I should be able to access HttpContext.Current
, but in my testing it shows up as null.
有没有什么办法让从重写提供商访问请求的内容?
Is there any way to get access to the request content from a rewrite provider?
推荐答案
这是因为它从来没有处理任何情况下最有可能为空。如果你想修改基于内容的URL,您应该实现在应用程序中的自定义IHttpModule的。
It's most likely null because it never processed any context. If you'd like to modify the url based on content, you should implement a custom IHttpModule in your application.
http://msdn.microsoft.com/en-us/library/ ms972974.aspx
这篇关于我如何可以访问请求体中的IIS重写提供商?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!