Actix - multipart/form_data

Hi there,
I'm trying to receive some form_data, send through a POST-request, and access them. However, I don't know how to manage that. My minimal code looks like this:

use actix_web::{web, App, HttpServer, HttpResponse, Responder};
use form_data::{handle_multipart, Form, Field};
use actix_multipart::Multipart;

fn send((mp, state): (Multipart, web::Data<Form>)) -> impl Responder {
    handle_multipart(mp, state.get_ref().clone());
     * My plan is, that now the received data are stored in "state"
    println!("{:?}", state);

fn main() -> std::io::Result<()> {
    let form = Form::new().field("test",Field::text());
    HttpServer::new(move || App::new()
                    .route("/send", web::post().to(send)))

Thanks for your help! :grinning:

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.