Is possible to pass more than one parameter into axtic_web route ?
// srv.rs (frag.)
HttpServer::new(|| {
App::new()
.route(
"/api/ext/{name}/set/config/{id}",
web::get().to(api::router::setExtConfig),
)
})
.start();
// router.rs (frag.)
pub fn setExtConfig(
name: web::Path<String>,
id: web::Path<String>,
_req: HttpRequest,
) -> HttpResponse {
println!("{} {}", name, id);
HttpResponse::Ok()
.content_type("text/html")
.body("OK")
}
For routes with one param everything is ok, but for this example
i see only message in the browser: wrong number of parameters: 2 expected 1
, and the response stauts code is 404.
I realy need to pass more parameters (from one to three or four)...