mirror of
https://github.com/tokio-rs/axum.git
synced 2025-04-03 21:15:55 +02:00
Clarify body extractors
This commit is contained in:
parent
62da1eac00
commit
341ad61240
2 changed files with 7 additions and 0 deletions
src/extract
|
@ -27,6 +27,10 @@ use tower::{BoxError, Layer, Service};
|
|||
/// produce any useful output, and run the extractor for several handlers
|
||||
/// without repeating it in the function signature.
|
||||
///
|
||||
/// Note that if the extractor consumes the request body, as `String` or
|
||||
/// [`Bytes`] does, an empty body will be left in its place. Thus wont be
|
||||
/// accessible to subsequent extractors or handlers.
|
||||
///
|
||||
/// # Example
|
||||
///
|
||||
/// ```rust
|
||||
|
|
|
@ -92,6 +92,9 @@
|
|||
//! # };
|
||||
//! ```
|
||||
//!
|
||||
//! Note that only one extractor can consume the request body. If multiple body extractors are
|
||||
//! applied a `500 Internal Server Error` response will be returned.
|
||||
//!
|
||||
//! # Optional extractors
|
||||
//!
|
||||
//! Wrapping extractors in `Option` will make them optional:
|
||||
|
|
Loading…
Add table
Reference in a new issue