#multipart #ureq #http

ureq_multipart

ureq multipart post toolkit

6 stable releases

1.1.1 Feb 6, 2023
1.1.0 Feb 5, 2023
1.0.3 Jan 30, 2023

#283 in HTTP client

Download history 238/week @ 2024-04-09 242/week @ 2024-04-16 228/week @ 2024-04-23 151/week @ 2024-04-30 110/week @ 2024-05-07 290/week @ 2024-05-14 229/week @ 2024-05-21 246/week @ 2024-05-28 337/week @ 2024-06-04 333/week @ 2024-06-11 359/week @ 2024-06-18 165/week @ 2024-06-25 199/week @ 2024-07-02 271/week @ 2024-07-09 212/week @ 2024-07-16 306/week @ 2024-07-23

1,018 downloads per month
Used in roboplc-cli

MIT/Apache

9KB
155 lines

ureq multipart post toolkit

a ureq http multipart post toolkit。

fork from multipart

Examples 1


use ureq_multipart::MultipartBuilder;

let (content_type,data) = MultipartBuilder::new()
            .add_file("test","/home/feiy/Desktop/1.txt").unwrap()
            .add_text("name","value")
            .finish().unwrap();
let resp: Value = ureq::post("http://some.service.url")
            .set("Content-Type", &content_type)
            .send_bytes(&data)?
            .into_json()?

Examples 2


use ureq_multipart::MultipartRequest;

let resp: Value = ureq::post("http://some.service.url")
            .send_multipart_file("name","&/home/feiy/Desktop/1.txt")?
            .into_json()?


lib.rs:

ureq multipart post toolkit

fork from multipart

Examples 1


use ureq_multipart::MultipartBuilder;

let (content_type,data) = MultipartBuilder::new()
            .add_file("test","/home/feiy/Desktop/1.txt").unwrap()
            .add_text("name","value")
            .finish().unwrap();
let resp: Value = ureq::post("http://some.service.url")
            .set("Content-Type", &content_type)
            .send_bytes(&data)?
            .into_json()?

Examples 2


use ureq_multipart::MultipartRequest;

let resp: Value = ureq::post("http://some.service.url")
            .send_multipart_file("name","&/home/feiy/Desktop/1.txt")?
            .into_json()?

Dependencies

~2.5MB
~71K SLoC