1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
//! A small blocking HTTP client on top of libcurl.
//!
//! `curlite` is for programs that call HTTP services and want to stay small:
//! no async runtime, one libcurl handle per thread with connection reuse,
//! request bodies held in memory once, and `multipart/form-data` in both
//! directions.
//!
//! ```no_run
//! use curlite::Multipart;
//!
//! let response = curlite::get("https://httpbin.org/get")
//! .query("page", "2")
//! .send()?;
//! println!("{} {}", response.status(), response.text()?);
//!
//! let response = curlite::post("https://httpbin.org/post")
//! .multipart(
//! Multipart::new()
//! .text("description", "report")
//! .file("file", "report.pdf", mime::APPLICATION_PDF, std::fs::read("report.pdf")?),
//! )
//! .send()?;
//! # Ok::<(), Box<dyn std::error::Error>>(())
//! ```
//!
//! Bodies are set with [`Request::body`] (raw bytes with a MIME type),
//! [`Request::form`] (`application/x-www-form-urlencoded`) or
//! [`Request::multipart`]. Multipart responses are split with
//! [`Response::parts`]. The [`params`] module adds a parameter model in
//! which the body format follows from the parameters.
//!
//! # TLS
//!
//! TLS comes from libcurl. By default the system libcurl is linked
//! dynamically, with whatever TLS library it was built against. The
//! `static-curl`, `static-ssl` and `rustls` features are passed through to
//! the [`curl`] crate to build and link libcurl statically instead.
pub use Multipart;
pub use ;
pub use ;
pub use ;
pub use Bytes;
pub use ;
pub use Mime;