Struct actix_web::dev::JsonConfig
[−]
[src]
pub struct JsonConfig { /* fields omitted */ }
Json extractor configuration
#[macro_use] extern crate serde_derive; use actix_web::{App, Json, Result, http}; #[derive(Deserialize)] struct Info { username: String, } /// deserialize `Info` from request's body, max payload size is 4kb fn index(info: Json<Info>) -> Result<String> { Ok(format!("Welcome {}!", info.username)) } fn main() { let app = App::new().resource( "/index.html", |r| { r.method(http::Method::POST) .with(index) .limit(4096);} // <- change json extractor configuration ); }
Methods
impl JsonConfig
[src]
ⓘImportant traits for &'a mut Wpub fn limit(&mut self, limit: usize) -> &mut Self
[src]
ⓘImportant traits for &'a mut W
Change max size of payload. By default max size is 256Kb