Skip to content

Instantly share code, notes, and snippets.

@sampletext32
Created December 23, 2020 16:36
Show Gist options
  • Save sampletext32/ba635cf41e4337edd8af6066bce6d0cc to your computer and use it in GitHub Desktop.
Save sampletext32/ba635cf41e4337edd8af6066bce6d0cc to your computer and use it in GitHub Desktop.
_logger.LogDebug(
$"ContentType: {httpContext.Request.ContentType}\n" +
$"ContentLength: {httpContext.Request.ContentLength}\n" +
$"Query: {string.Join(", ", from q in httpContext.Request.Query select $"{q.Key} = {string.Join(",", q.Value)};")}\n" +
$"Cookies: {string.Join(", ", from c in httpContext.Request.Cookies select $"{c.Key} = {c.Value};")}\n" +
$"HasFormContentType: {httpContext.Request.HasFormContentType}\n" +
$"Headers: {string.Join(", ", from h in httpContext.Request.Headers select $"{h.Key} = {string.Join(",", h.Value)};")}\n" +
$"Host: {httpContext.Request.Host.Value}\n" +
$"IsHttps: {httpContext.Request.IsHttps}\n" +
$"Method: {httpContext.Request.Method}\n" +
$"PathBase: {httpContext.Request.PathBase.Value}\n" +
$"Protocol: {httpContext.Request.Protocol}\n" +
$"QueryString: {httpContext.Request.QueryString.Value}\n" +
$"RouteValues: {string.Join(", ", from rv in httpContext.Request.RouteValues select $"{rv.Key}={rv.Value};")}\n" +
$"Scheme: {httpContext.Request.Scheme}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment