KestrunResponse.WriteHtmlResponseAsync method

Asynchronously writes an HTML response, rendering the provided template string and replacing placeholders with values from the given dictionary.

public Task WriteHtmlResponseAsync(string template, IReadOnlyDictionary<string, object?>? vars, 
    int statusCode = 200)
parameter description
template The HTML template string containing placeholders.
vars A dictionary of variables to replace in the template.
statusCode The HTTP status code for the response.

See Also