# Text Responses
The simplest form of response in Actix Web is plain text.
#Returning Strings
Actix Web's Responder trait is implemented for String and &'static str. This means you can return strings directly from your handlers, and Actix Web will automatically set the Content-Type to text/plain and the status to 200 OK.
code_blocksrust
use actix_web::{get, Responder};
#[get("/hello")]
async fn hello() -> impl Responder {
"Hello, world!" // Returns text/plain
}#Customizing via HttpResponse
If you need more control over status codes or headers, use the HttpResponse builder.
code_blocksrust
use actix_web::{HttpResponse, Responder};
async fn custom_text() -> impl Responder {
HttpResponse::Accepted()
.content_type("text/plain")
.body("Processing request...")
}