title: How to get header values in https calls in c#
body: <p>I have created an API which gets a header value which it matches with the <code>apikey</code> from the web.config.</p>
  
  <p><a href="https://i.stack.imgur.com/DijiZ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DijiZ.png" alt="enter image description here"></a></p>
  
  <p>and the code to get the header value in the application is</p>
  
  <pre><code>  var authToken = Request.Headers.Where(t =&gt; t.Key == "apiKey").ToList();
  </code></pre>
  
  <p>It works perfectly when I work with HTTP but when I use HTTPS it doesn't get the header value.</p>
  
  <p><a href="https://i.stack.imgur.com/HboQK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/HboQK.png" alt="enter image description here"></a></p>
  
  <p>As shown in the image <code>authToken.count = 0</code> which means it is not getting the header value.</p>
  
  <p>The request object is of type <code>public HttpRequestMessage Request { get; set; }</code></p>
  
  <p>Can someone please suggest me where I am making the mistake.</p>