How to access ServerVariables in AspnetCore 1.0

When creating a .Net website, server variables are accessed using

HttpContext.Current.Request.ServerVariables["HTTP_ACCEPT_LANGUAGE"]

How to access ServerVariables in AspnetCore 1.0 web application?
When debugging, the internal controller this.HttpContext.Featuresdoes not contain IServerVariablesFeature.

+4
source share
2 answers

Well, I will not directly answer your question. I will try to talk about why this server variable is no longer a problem.

"HTTP_ACCEPT_LANGUAGE" is the server variable that IIS and .NET used to simplify on the ASP.NET platform to transfer content using the application.

Accept-Language. , , IIS, , , , , , .

, ,

  • Accept-Language. , "" devtools HTTP-.

Chrome browser showing reception language

  1. Http .NET .

    Windows.NET framework

    HttpRequest dotnet

  2. , -. , , , . - -, -.

, .

, dotnet , , -. .

, , - ,

+5

, . , , . , ?

+2

Source: https://habr.com/ru/post/1648200/


All Articles