How to Get Header Values

2019-07-23 19:06发布

问题:

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"]);