mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-27 00:00:24 +02:00
Remove B type param (#1751)
Co-authored-by: Jonas Platte <[email protected]> Co-authored-by: Michael Scofield <[email protected]>
This commit is contained in:
co-authored by
Jonas Platte
Michael Scofield
parent
9be0ea934c
commit
4e4c29175f
@@ -5,9 +5,9 @@
|
||||
//! ```
|
||||
|
||||
use axum::{
|
||||
body::Bytes,
|
||||
extract::{BodyStream, Multipart, Path},
|
||||
http::StatusCode,
|
||||
body::{Body, Bytes},
|
||||
extract::{Multipart, Path},
|
||||
http::{Request, StatusCode},
|
||||
response::{Html, Redirect},
|
||||
routing::{get, post},
|
||||
BoxError, Router,
|
||||
@@ -52,9 +52,9 @@ async fn main() {
|
||||
// POST'ing to `/file/foo.txt` will create a file called `foo.txt`.
|
||||
async fn save_request_body(
|
||||
Path(file_name): Path<String>,
|
||||
body: BodyStream,
|
||||
request: Request<Body>,
|
||||
) -> Result<(), (StatusCode, String)> {
|
||||
stream_to_file(&file_name, body).await
|
||||
stream_to_file(&file_name, request.into_body()).await
|
||||
}
|
||||
|
||||
// Handler that returns HTML for a multipart form.
|
||||
|
||||
Reference in New Issue
Block a user