# HTML Responses
While Actix Web is often used for APIs, it can also serve traditional HTML pages.
#Sending HTML Strings
If you return a raw string containing HTML, you must explicitly set the Content-Type, otherwise browsers will display it as plain text.
code_blocksrust
use actix_web::{get, HttpResponse, Responder};
#[get("/")]
async fn index() -> impl Responder {
HttpResponse::Ok()
.content_type("text/html; charset=utf-8")
.body("<h1>Hello World</h1>")
}#HTML Templating
For dynamic HTML, you integrate template engines like Askama, Tera, or Handlebars. You render the template to a string and return it as the body of an HttpResponse.