quickhttp/
lib.rs

1//! # http-client
2//! > A small library for making HTTP requests
3//! Designed to be a small, simple, and easy to use library for making HTTP requests.
4//! Supports all key features of HTTP
5//! Can be used synchronously or asynchronously (for example with `tokio`)
6
7
8/// Request Builder type, allowing creation of a request
9pub mod builder;
10/// import the builder trait, to make the exposed builder trait available
11pub use builder::ValidBuilder;
12
13/// Request type, designed to be generated from a builder
14pub mod request;
15/// import the request trait, to make the exposed request trait available
16pub use request::ValidRequest;
17
18/// Response type, designed to be generated from a request
19pub mod response;
20/// import the response trait, to make the exposed response trait available
21pub use response::ValidResponse;
22
23/// Error type, designed to be generated from a response
24mod errors;
25
26/// status code types, designed to be used in the response field
27pub mod status_code;
28/// import the status code enum
29pub use status_code::StatusCode;
30
31#[cfg(test)]
32mod tests {
33    use super::*;
34    use builder::Builder;
35
36    #[test]
37    fn test_builder() {
38        let res = Builder::new()
39            .uri("http://httpbin.org/ip".to_string())
40            .method("GET".to_string())
41            .build()
42            .unwrap()
43            .send()
44            .unwrap();
45
46
47        println!("{:?}", res.body);
48    }
49}