HttpContextExtensions.GetIISServerVariable(HttpContext, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Caution
This is obsolete and will be removed in a future version. Use GetServerVariable instead.
Gets the value of a server variable for the current request.
public:
[System::Runtime::CompilerServices::Extension]
static System::String ^ GetIISServerVariable(Microsoft::AspNetCore::Http::HttpContext ^ context, System::String ^ variableName);
public static string GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
[System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")]
public static string GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
[System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")]
public static string? GetIISServerVariable (this Microsoft.AspNetCore.Http.HttpContext context, string variableName);
static member GetIISServerVariable : Microsoft.AspNetCore.Http.HttpContext * string -> string
[<System.Obsolete("This is obsolete and will be removed in a future version. Use GetServerVariable instead.")>]
static member GetIISServerVariable : Microsoft.AspNetCore.Http.HttpContext * string -> string
<Extension()>
Public Function GetIISServerVariable (context As HttpContext, variableName As String) As String
Parameters
- context
- HttpContext
The http context for the request.
- variableName
- String
The name of the variable.
Returns
null
if the server does not support the IServerVariablesFeature feature.
May return null or empty if the variable does not exist or is not set.
- Attributes
Remarks
For a list of common server variables available in IIS, see http://go.microsoft.com/fwlink/?LinkId=52471.