Question: HttpContext Header is empty when attempt to retrieve data in C#, why is that?
Answer: There is a chance that you are trying to retrieve the Keys from the HttpContext Header in a wrong way. Keep in mind that HttpContext Header Keys shows differently when you step in the HttpContext using a Debugger, however, when actually quering the Values you need to drop the "Header" section. For Example:
var UserAgent = httpContext.Request.Header["HeaderUserAgent"] //This is wrong and will not yeld any results
var UserAgent = httpContext.Request.Header["User-Agent"] //This is right, will yeld results.
- Hope this helps you.