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.
toml
[dependencies]
multipart-rfc7578 = "0.3"
Because the name of this library is really wordy, I recommend shortening it:
Using this requires a hyper client compatible with the multipart::Body
data structure (see the documentation for more detailed examples):
```rust
use hyper::{Client, Request, rt::{self, Future}}; use multipart_rfc7578::MultipartForm;
let client = Client::new(); let mut req_builder = Request::get("http://localhost/upload"); let mut form = MultipartForm::default();
form.addtext("test", "Hello World"); let req = form.setbody(&mut req_builder).unwrap();
rt::run( client .request(req) .map(|| println!("done...")) .maperr(|_| println!("an error occurred")), ); ```
I don't have any plans on implementing the server-side of this any time soon. I ended up implementing the client-side because I couldn't find any good libraries that were compatible with hyper >= 0.11.
Please feel free to submit a pull request, I would gladly review it!
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.