89 releases (29 stable)

3.12.0 Feb 18, 2026
3.11.2 Oct 5, 2025
3.11.1 Aug 26, 2025
3.11.0 May 10, 2025
0.1.0-alpha.2 Mar 30, 2019

#5 in #actix

Download history 466858/week @ 2025-12-18 240686/week @ 2025-12-25 431676/week @ 2026-01-01 643861/week @ 2026-01-08 707614/week @ 2026-01-15 803896/week @ 2026-01-22 771881/week @ 2026-01-29 707560/week @ 2026-02-05 641386/week @ 2026-02-12 781036/week @ 2026-02-19 788739/week @ 2026-02-26 921405/week @ 2026-03-05 970611/week @ 2026-03-12 659675/week @ 2026-03-19 633213/week @ 2026-03-26 477394/week @ 2026-04-02

2,902,697 downloads per month
Used in 1,789 crates (198 directly)

MIT/Apache

650KB
15K SLoC

actix-http

HTTP types and services for the Actix ecosystem.

crates.io Documentation Version MIT or Apache 2.0 licensed
dependency status Download Chat on Discord

Examples

use std::{env, io};

use actix_http::{HttpService, Response};
use actix_server::Server;
use futures_util::future;
use http::header::HeaderValue;
use tracing::info;

#[actix_rt::main]
async fn main() -> io::Result<()> {
    env::set_var("RUST_LOG", "hello_world=info");
    env_logger::init();

    Server::build()
        .bind("hello-world", "127.0.0.1:8080", || {
            HttpService::build()
                .client_timeout(1000)
                .client_disconnect(1000)
                .finish(|_req| {
                    info!("{:?}", _req);
                    let mut res = Response::Ok();
                    res.header("x-head", HeaderValue::from_static("dummy value!"));
                    future::ok::<_, ()>(res.body("Hello world!"))
                })
                .tcp()
        })?
        .run()
        .await
}

Dependencies

~12–30MB
~442K SLoC