# Path Parameters
Often, URLs contain dynamic segments that represent resource identifiers, such as user IDs or product slugs. Actix Web makes it easy to extract these segments using path parameters.
#How It Works
You define a dynamic segment in your route path using curly braces, like /users/{user_id}. Actix Web then extracts this value and provides it to your handler via the web::Path extractor.
#Multiple Parameters
You can extract multiple parameters by specifying them in your path and grouping them in a tuple or struct inside web::Path.
use actix_web::{get, web, Result};
use serde::Deserialize;
#[derive(Deserialize)]
struct Info {
user_id: u32,
friend: String,
}
#[get("/users/{user_id}/{friend}")]
async fn get_friend(info: web::Path<Info>) -> Result<String> {
Ok(format!("Welcome {}, friend of {}", info.friend, info.user_id))
}#Type Safety
Because Actix Web uses Serde for deserialization, path parameters are strictly typed. If a request comes in with a non-integer value for user_id in the example above, Actix Web will automatically return a 400 Bad Request error.