title: How to extract custom header value?
body: <p>I have this exact code from the accepted answer in my project which I need to migrate into ASP.NET Core MVP.</p>
  
  <p><a href="https://stackoverflow.com/questions/14967457/how-to-extract-custom-header-value-in-web-api-message-handler">How to extract custom header value in Web API message handler?</a></p>
  
  <pre><code>var env = Request.Headers.GetValues("environment").First();
  </code></pre>
  
  <p>How can I implement this in .NET Core?</p>
  
  <p>I hope this is not considered to be a duplicate question because I am trying to do this with the new system rather than the old one. I would also be fine if someone adds an answer to the link regarding the current version.</p>
  
  <p>Edit: <a href="https://stackoverflow.com/questions/29706719/where-all-types-for-http-headers-gone-in-asp-net-5">Where all types for http headers gone in ASP.NET 5?</a> I tried this link but API may have changed. I don't think this is a duplicate for that question either.</p>