MCPcopy Create free account
hub / github.com/actix/examples / handle_post_2

Function handle_post_2

forms/form/src/main.rs:52–60  ·  view source on GitHub ↗

State and POST Params

(
    state: web::Data<AppState>,
    params: web::Form<MyParams>,
)

Source from the content-addressed store, hash-verified

50
51/// State and POST Params
52async 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
63async fn handle_post_3(req: HttpRequest, params: web::Form<MyParams>) -> impl Responder {

Callers 1

handle_post_2_unit_testFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected