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

Function greet

json/json-decode-error/src/main.rs:10–12  ·  view source on GitHub ↗
(name: web::Json<Info>)

Source from the content-addressed store, hash-verified

8
9#[post("/")]
10async fn greet(name: web::Json<Info>) -> impl Responder {
11 HttpResponse::Ok().body(format!("Hello {}!", name.name))
12}
13
14fn json_error_handler(err: error::JsonPayloadError, _req: &HttpRequest) -> error::Error {
15 use actix_web::error::JsonPayloadError;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected