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

Function index

json/json/src/main.rs:11–14  ·  view source on GitHub ↗

This handler uses json extractor

(item: web::Json<MyObj>)

Source from the content-addressed store, hash-verified

9
10/// This handler uses json extractor
11async fn index(item: web::Json<MyObj>) -> HttpResponse {
12 println!("model: {:?}", item);
13 HttpResponse::Ok().json(item.0) // <- send response
14}
15
16/// This handler uses json extractor with limit
17async fn extract_item(item: web::Json<MyObj>, req: HttpRequest) -> HttpResponse {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected