// minimal api doe not support this natively
type HtmlResult(html) =
interface IResult with
member this.ExecuteAsync(httpContext) =
httpContext.Response.ContentType <- MediaTypeNames.Text.Html
httpContext.Response.ContentLength <- Encoding.UTF8.GetByteCount(s = html)
httpContext.Response.WriteAsync(html)
static member Create(html) = new HtmlResult(html)
this could be an html return type, when returned in middleware seems not working?
this could be an html return type, when returned in middleware seems not working?
https://learn.microsoft.com/en-us/aspnet/core/fundamentals/minimal-apis/responses?view=aspnetcore-8.0