Expand description
HTML responses: shortcut for returning rendered markup from handlers.
HtmlServiceResult::ok wraps an HTML string in a 200 ServiceResult
with ResponseType::Html, so the router renders it as text/html.
ⓘ
async fn page(ctx: CorrelationContext) -> Result<ServiceResult<String>, ErrorResult> {
Ok(HtmlServiceResult::ok("<h1>Hello</h1>"))
}Structs§
- Html
Service Result - Shortcut constructors for HTML handler results.