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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
//! cdumay_http_client is a basic library used to standardize result and serialize them using [serde](https://docs.serde.rs/serde/).
//!
//! ## Quickstart
//!
//! _Cargo.toml_:
//! ```toml
//! [dependencies]
//! cdumay_error = "0.3"
//! cdumay_result = "0.3"
//! cdumay_http_client = "0.3"
//! ```
//!
//! _main.rs_:
//!
//! ```rust
//! extern crate cdumay_error;
//! extern crate cdumay_http_client;
//! extern crate serde_json;
//!
//! use cdumay_error::JsonError;
//! use cdumay_http_client::authentication::NoAuth;
//! use cdumay_http_client::{ClientBuilder, HttpClient};
//!
//! fn main() {
//! use cdumay_http_client::BaseClient;
//! let cli = HttpClient::new("https://www.rust-lang.org").unwrap();
//! let result = cli.get("/learn/get-started".into(), None, None, None, None);
//!
//! match result {
//! Ok(data) => println!("{}", data),
//! Err(err) => println!("{}", serde_json::to_string_pretty(&JsonError::from(err)).unwrap()),
//! }
//! }
//! ```
//! _Output_:
//! ```html
//! <!doctype html>
//! <html lang="en-US">
//! <head>
//! <meta charset="utf-8">
//! <title>
//! [...]
//! ```
//! ## Errors
//!
//! Errors can be displayed using [cdumay_error](https://docs.serde.rs/cdumay_error/):
//!
//! ```json
//! {
//! "code": 500,
//! "message": "error trying to connect",
//! "msgid": "Err-05192"
//! }
//! ```
extern crate cdumay_error;
extern crate cdumay_result;
extern crate chrono;
extern crate http;
extern crate humantime;
extern crate log;
extern crate reqwest;
extern crate serde;
extern crate base64;
extern crate serde_json;
pub use ;
pub use ;