Philip Tenn
Philip Tenn

Reputation: 6083

ASP.NET MVC Request ServerVariables

I am using ASP.NET MVC, and need to obtain and log Request Information.

I'm looking at Microsoft​.AspNetCore​.Http.HttpRequest and do not see ServerVariables. Has this been removed?

Is there a way I can get to the same data as I could via System.Web.HttpRequest.ServerVariables?

Thanks!

Philip

Upvotes: 3

Views: 4364

Answers (1)

NtFreX
NtFreX

Reputation: 11387

Microsoft​.AspNetCore​.Http.HttpRequest is as the namespace says part of asp.net core. The ServerVariables is a collection of variables provided by IIS. As asp.net core does not depend on IIS this property doesn't exist anymore.


If do not use asp.net core this is the HttpRequest class to use.

Upvotes: 3

Related Questions