#multipart #http #ureq

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

#342 in HTTP client

Download history 280/week @ 2024-07-22 226/week @ 2024-07-29 412/week @ 2024-08-05 261/week @ 2024-08-12 377/week @ 2024-08-19 249/week @ 2024-08-26 181/week @ 2024-09-02 148/week @ 2024-09-09 181/week @ 2024-09-16 373/week @ 2024-09-23 250/week @ 2024-09-30 164/week @ 2024-10-07 85/week @ 2024-10-14 108/week @ 2024-10-21 49/week @ 2024-10-28 74/week @ 2024-11-04

321 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

~3–4.5MB
~79K SLoC