1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-06-26 15:07:42 +02:00

actix-multipart: Feature: Add typed multipart form extractor (#2883)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Jacob Halsey
2023-02-26 03:26:06 +00:00
committed by GitHub
parent 358c1cf85b
commit d4b833ccf0
30 changed files with 2017 additions and 32 deletions

View File

@ -0,0 +1,19 @@
use actix_web::{web, App, Responder};
use actix_multipart::form::{tempfile::TempFile, text::Text, MultipartForm};
#[derive(Debug, MultipartForm)]
struct ImageUpload {
description: Text<String>,
timestamp: Text<i64>,
image: TempFile,
}
async fn handler(_form: MultipartForm<ImageUpload>) -> impl Responder {
"Hello World!"
}
#[actix_web::main]
async fn main() {
App::new().default_service(web::to(handler));
}