这种情况下,无法填写html ,因为永远都会转义
app.MapGet("/", () => "This is a POST /swagger/index.html");
需要改为下面这种
app.MapGet("/", async context =>
{
context.Response.Headers.Add("Content-Type", "text/html");
await context.Response.WriteAsync("<a href=\"/swagger/index.html\">SWAGGER API</a><br/> ");
});
网友评论