Add example showing how to handle empty vs missing query params (#443)

This commit is contained in:
David Pedersen
2021-11-02 14:42:47 +01:00
committed by GitHub
parent a048d6443b
commit 98907b8887
3 changed files with 133 additions and 0 deletions
+5
View File
@@ -39,6 +39,11 @@ use std::ops::Deref;
///
/// If the query string cannot be parsed it will reject the request with a `400
/// Bad Request` response.
///
/// For handling values being empty vs missing see the (query-params-with-empty-strings)[example]
/// example.
///
/// [example]: https://github.com/tokio-rs/axum/blob/main/examples/query-params-with-empty-strings/src/main.rs
#[derive(Debug, Clone, Copy, Default)]
pub struct Query<T>(pub T);