1
0
mirror of https://github.com/actix/actix-website synced 2025-03-16 05:02:45 +01:00
actix-website/examples/server/src/keep_alive_tp.rs
2019-12-29 03:32:56 +09:00

14 lines
378 B
Rust

// <example>
use actix_web::{http, HttpRequest, HttpResponse};
async fn index(req: HttpRequest) -> HttpResponse {
HttpResponse::Ok()
.connection_type(http::ConnectionType::Close) // <- Close connection
.force_close() // <- Alternative method
.finish()
}
// </example>
// ConnectionType::Close
// ConnectionType::KeepAlive
// ConnectionType::Upgrade