Expand description

This crate contains an implementation of the multipart/form-data media type described in RFC 7578 for actix-web.

Usage

Declare the dependency:

[dependencies]
actix-multipart-rfc7578 = "0.9"

Import the crate:

extern crate actix_multipart_rfc7578 as multipart;

Example:

use actix_multipart_rfc7578::client::{self, multipart};
use awc::Client;

#[actix_rt::main]
async fn main() {
  let mut form = multipart::Form::default();

  form.add_text("test", "Hello World");

  let response = Client::default()
    .get("http://localhost/upload")
    .content_type(form.content_type())
    .send_body(multipart::Body::from(form))
    .await;

  if let Ok(_) = response {
    println!("done...");
  } else {
    eprintln!("an error occurred");
  }
}

Modules