开发者

Access to request HTTP headers in custom WCF MessageEncoder

开发者 https://www.devze.com 2022-12-15 02:41 出处:网络
Does anyone know how to get access to request HTTP headers within MessageEncoder.ReadMessage method? It seems that WCF already \"knows\" request headers at t开发者_JS百科he point of invoking ReadMessa

Does anyone know how to get access to request HTTP headers within MessageEncoder.ReadMessage method? It seems that WCF already "knows" request headers at t开发者_JS百科he point of invoking ReadMessage method, at least Content-Type and Content-Length but I cannot get the access to the Content-Encoding header.

Basically, I'm trying to utilize gzip de/compression for WCF service (http://msdn.microsoft.com/en-us/library/ms751458.aspx) and would like to check if decompression is necessary for incoming request. To do that I'd like to check Content-Encoding header but cannot figure out where to get it. Any ideas?

Thanks!


Here's an answer I gave in another thread which explains how you would need to manipulate the headers via the WebOperationContext in another IOperationBehavior which is coupled with the MessageEncoder.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号