Function warp::reply::html

source ·
pub fn html<T>(body: T) -> Html<T>
where Body: From<T>, T: Send,
Expand description

Reply with a body and content-type set to text/html; charset=utf-8.

§Example

use warp::Filter;

let body = r#"
<html>
    <head>
        <title>HTML with warp!</title>
    </head>
    <body>
        <h1>warp + HTML = &hearts;</h1>
    </body>
</html>
"#;

let route = warp::any()
    .map(move || {
        warp::reply::html(body)
    });