mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-24 00:00:16 +02:00
More docs
This commit is contained in:
+7
-1
@@ -248,7 +248,13 @@ async fn extracting_url_params() {
|
||||
.post(
|
||||
|_: Request<Body>, params_map: extract::UrlParamsMap| async move {
|
||||
assert_eq!(params_map.get("id").unwrap(), "1337");
|
||||
assert_eq!(params_map.get_typed::<i32>("id").unwrap(), 1337);
|
||||
assert_eq!(
|
||||
params_map
|
||||
.get_typed::<i32>("id")
|
||||
.expect("missing")
|
||||
.expect("failed to parse"),
|
||||
1337
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user