How can I access header values from a web method in WCF Web API?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
You can try something like this:
(using System.Web;)
HttpUtility.UrlDecode(HttpContext.Current.Request.Headers["myValue"]);
How can I access header values from a web method in WCF Web API?
You can try something like this:
(using System.Web;)
HttpUtility.UrlDecode(HttpContext.Current.Request.Headers["myValue"]);