1
0
mirror of https://github.com/actix/actix-website synced 2025-01-08 02:32:37 +01:00
actix-website/examples/requests/src/multipart.rs

26 lines
923 B
Rust
Raw Normal View History

2019-06-17 20:34:23 +02:00
// <multipart>
// use actix_web::{error, Error, HttpRequest, HttpResponse};
// use futures::Future;
// pub fn index(req: HttpRequest) -> Box<Future<Item = HttpResponse, Error = Error>> {
2019-06-17 20:34:23 +02:00
// // get multipart and iterate over multipart items
// req.multipart().and_then(|item| match item {
// multipart::MultipartItem::Field(field) => {
// println!(
// "==== FIELD ==== {:?} {:?}",
// field.headers(),
// field.content_type()
// );
// Either::A(
// field
// .map(|chunk| {
// println!("-- CHUNK: \n{}", std::str::from_utf8(&chunk).unwrap());
// })
// .fold((), |_, _| result(Ok(()))),
// )
// }
// multipart::MultipartItem::Nested(mp) => Either::B(result(Ok(()))),
// })
// }
// </multipart>