Crate hyper_multipart_rfc7578_mem_uploads [] [src]

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

Currently, only the client-side is implemented.

Usage

[dependencies]
hyper-multipart-rfc7578 = "0.1.0-alpha2"

Because the name of this library is really wordy, I recommend shortening it:

extern crate hyper_multipart_rfc7578 as hyper_multipart;

Using this requires a hyper client compatible with the multipart::Body data structure (see the documentation for more detailed examples):

use hyper::{Method, Request};
use hyper::client::Client;
use hyper_multipart_rfc7578::client::{self, multipart};
use tokio_core::reactor::{Core, Handle};

let mut core = Core::new().unwrap();
let client: Client<_, multipart::Body> = client::create(&core.handle());
let mut req = Request::new(Method::Get, "http://localhost/upload".parse().unwrap());
let mut form = multipart::Form::default();

form.add_text("test", "Hello World");
form.set_body(&mut req);

core.run(client.request(req));

Modules

client

Multipart RFC 7578 - Client