This handler uses json extractor with limit
(item: web::Json<MyObj>, req: HttpRequest)
| 15 | |
| 16 | /// This handler uses json extractor with limit |
| 17 | async fn extract_item(item: web::Json<MyObj>, req: HttpRequest) -> HttpResponse { |
| 18 | println!("request: {req:?}"); |
| 19 | println!("model: {item:?}"); |
| 20 | |
| 21 | HttpResponse::Ok().json(item.0) // <- send json response |
| 22 | } |
| 23 | |
| 24 | /// This handler manually load request payload and parse json object |
| 25 | async fn index_manual(body: web::Bytes) -> Result<HttpResponse, Error> { |
nothing calls this directly
no outgoing calls
no test coverage detected