emilk / ehttp

Minimal Rust HTTP client for both native and WASM
Apache License 2.0
323 stars 30 forks source link

I added a multipart feature #34

Closed JustFrederik closed 9 months ago

JustFrederik commented 1 year ago

Its basically just ureq_multipart, but without the converion to ureqs Request so it will work with wasm.

use ehttp::multipart::MultipartBuilder;
let builder = MultipartBuilder::new()
            .add_file("test","/home/feiy/Desktop/1.txt").unwrap()
            .add_text("name","value");
let request = ehttp::Request:multipart(url, builder);
JustFrederik commented 1 year ago

thank you! Can you please add some helpful docstrings to the key things? 🙏

Especially to Request::multipart and to MultipartBuilder

I added an example to request::multipart. The multipart builder already had some documentation, but is also used in the example

JustFrederik commented 1 year ago

Should I add the method setter?

tmtbe commented 11 months ago

This pr doesn't seem to have changed in a long time.