3

I am trying to rewrite this line of code HttpContext.Current.Request.ServerVariables["HTTP_HOST"] it cant find current it doesn't contain a definition.

jps
  • 20,041
  • 15
  • 75
  • 79
Spafa9
  • 742
  • 3
  • 14
  • 30

1 Answers1

1

There is an extension in .net core. To use it you need to install prerequested package which denoted below.

https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.http.httpcontextservervariableextensions.getservervariable?view=aspnetcore-5.0

Ulas
  • 19
  • 4