-
|
In actix-web, is it possible to do something like that ? #[get("/data/{...args}")
pub async fn get_data(args: web::Path<Vec<String>>) -> Result<HttpResponse, Error> {
....
} |
Beta Was this translation helpful? Give feedback.
Answered by
robjtede
Jun 11, 2022
Replies: 1 comment
-
|
Using a tail segment should be reasonably clean. #[get("/data/{args}*")
pub async fn get_data(args: web::Path<String>) -> Result<HttpResponse, Error> {
let args = args.split("/").collect::<Vec<_>>();
....
}(untested snippet) see https://docs.rs/actix-router/latest/actix_router/struct.ResourceDef.html#tail-segments |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
leo91000
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using a tail segment should be reasonably clean.
(untested snippet)
see https://docs.rs/actix-router/latest/actix_router/struct.ResourceDef.html#tail-segments