header routing
This commit is contained in:
parent
ef47d7082c
commit
71d1b559a8
5 changed files with 36 additions and 55 deletions
|
|
@ -18,6 +18,7 @@ app.MapGet("/{**ok}", async (HttpContext context) =>
|
|||
var headers = request.Headers;
|
||||
|
||||
var responseText = new System.Text.StringBuilder();
|
||||
responseText.AppendLine("<pre>");
|
||||
responseText.AppendLine($"Server Name: {name}");
|
||||
responseText.AppendLine($"IP Address: {ip}");
|
||||
responseText.AppendLine($"Method: {method}");
|
||||
|
|
@ -30,6 +31,7 @@ app.MapGet("/{**ok}", async (HttpContext context) =>
|
|||
{
|
||||
responseText.AppendLine($" {header.Key}: {header.Value}");
|
||||
}
|
||||
responseText.AppendLine("</pre>");
|
||||
|
||||
await context.Response.WriteAsync(responseText.ToString());
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue