ASP.NET Request variable. This layout renderer is non supported ASP.NET Core!
Supported in .NET and Mono
This layout renderer is broken down to separate layout renders who are more ASP.NET Core compatible / future proof:
- ${aspnet-Request-Cookie} - ASP.NET Request cookie content.
- ${aspnet-Request-Host} - ASP.NET Request host.
- ${aspnet-Request-Ip} - ASP.NET Request Client IP address
- ${aspnet-Request-Method} - ASP.NET Request method (GET, POST etc).
- ${aspnet-Request-QueryString} - ASP.NET Request querystring.
- ${aspnet-Request-Referrer} - ASP.NET Request referrer.
- ${aspnet-Request-UserAgent} - ASP.NET Request useragent.
- ${aspnet-Request-Url} - ASP.NET Request URL.
${aspnet-request:cookie=String:serverVariable=String:queryString=String
:item=String:form=String:header=String}
- cookie - Cookie to be rendered.
- header - Request header. Introduced in NLog.Web 4.2
- serverVariable - ServerVariables item to be rendered. See for possible options: msdn. Not supported in ASP.NET Core.
- queryString - QueryString variable to be rendered.
- item - Item name. The QueryString, Form, Cookies, or ServerVariables collection variables having the specified name are rendered.
- form - Form variable to be rendered. Note: The Form property is populated when the HTTP request Content-Type value is either "application/x-www-form-urlencoded" or "multipart/form-data". (see msdn)
Use this layout renderer to insert the value of the specified parameter of the ASP.NET Request object. This renderer requires the NLog.Web package.
Full URL without domain, eg default.aspx?id=512
${aspnet-request:serverVariable=HTTP_URL}${aspnet-request:queryString}
URL doing the request. Including schema (e.g https://
) and querystring
${aspnet-request:header=Referer}
Content-Type like application/json; charset=UTF-8
${aspnet-request:header=Content-Type}
Method like PUT, POST, GET etc
${aspnet-request:serverVariable=REQUEST_METHOD}
user agent, like Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36
${aspnet-request:serverVariable=HTTP_USER_AGENT}