mirror of https://github.com/fafhrd91/actix-web
Simplify FormConfig/QueryConfig doc examples.
This commit is contained in:
parent
35a0dae4e4
commit
fcbff5ad19
|
@ -195,7 +195,7 @@ impl<T: Serialize> Responder for Form<T> {
|
||||||
/// web::resource("/index.html")
|
/// web::resource("/index.html")
|
||||||
/// // change `Form` extractor configuration
|
/// // change `Form` extractor configuration
|
||||||
/// .app_data(
|
/// .app_data(
|
||||||
/// web::Form::<FormData>::configure(|cfg| cfg.limit(4097))
|
/// web::FormConfig::default().limit(4097)
|
||||||
/// )
|
/// )
|
||||||
/// .route(web::get().to(index))
|
/// .route(web::get().to(index))
|
||||||
/// );
|
/// );
|
||||||
|
|
|
@ -188,12 +188,12 @@ where
|
||||||
/// let app = App::new().service(
|
/// let app = App::new().service(
|
||||||
/// web::resource("/index.html").app_data(
|
/// web::resource("/index.html").app_data(
|
||||||
/// // change query extractor configuration
|
/// // change query extractor configuration
|
||||||
/// web::Query::<Info>::configure(|cfg| {
|
/// web::QueryConfig::default()
|
||||||
/// cfg.error_handler(|err, req| { // <- create custom error response
|
/// .error_handler(|err, req| { // <- create custom error response
|
||||||
/// error::InternalError::from_response(
|
/// error::InternalError::from_response(
|
||||||
/// err, HttpResponse::Conflict().finish()).into()
|
/// err, HttpResponse::Conflict().finish()).into()
|
||||||
/// })
|
/// })
|
||||||
/// }))
|
/// )
|
||||||
/// .route(web::post().to(index))
|
/// .route(web::post().to(index))
|
||||||
/// );
|
/// );
|
||||||
/// }
|
/// }
|
||||||
|
|
Loading…
Reference in New Issue