State and POST Params
(
state: web::Data<AppState>,
params: web::Form<MyParams>,
)
| 50 | |
| 51 | /// State and POST Params |
| 52 | async fn handle_post_2( |
| 53 | state: web::Data<AppState>, |
| 54 | params: web::Form<MyParams>, |
| 55 | ) -> Result<HttpResponse> { |
| 56 | Ok(HttpResponse::Ok().content_type("text/plain").body(format!( |
| 57 | "Your name is {}, and in AppState I have foo: {}", |
| 58 | params.name, state.foo |
| 59 | ))) |
| 60 | } |
| 61 | |
| 62 | /// Request and POST Params |
| 63 | async fn handle_post_3(req: HttpRequest, params: web::Form<MyParams>) -> impl Responder { |
no outgoing calls
no test coverage detected