mirror of
https://github.com/fafhrd91/actix-web
synced 2025-08-20 12:45:41 +02:00
simplify http response construction; deprecate httpcodes
This commit is contained in:
@@ -22,11 +22,11 @@ header! {
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
/// use actix_web::httpcodes;
|
||||
/// use actix_web::HttpResponse;
|
||||
/// use actix_web::http::header::Expires;
|
||||
/// use std::time::{SystemTime, Duration};
|
||||
///
|
||||
/// let mut builder = httpcodes::HttpOk.build();
|
||||
/// let mut builder = HttpResponse::Ok();
|
||||
/// let expiration = SystemTime::now() + Duration::from_secs(60 * 60 * 24);
|
||||
/// builder.set(Expires(expiration.into()));
|
||||
/// ```
|
||||
|
Reference in New Issue
Block a user