mirror of
https://github.com/actix/actix-website
synced 2025-02-02 20:29:03 +01:00
11 lines
291 B
Rust
11 lines
291 B
Rust
|
// <example>
|
||
|
use actix_web::{http, HttpRequest, HttpResponse};
|
||
|
|
||
|
fn index(req: HttpRequest) -> HttpResponse {
|
||
|
HttpResponse::Ok()
|
||
|
.connection_type(http::ConnectionType::Close) // <- Close connection
|
||
|
.force_close() // <- Alternative method
|
||
|
.finish()
|
||
|
}
|
||
|
// </example>
|