|
1 | 1 | # http_req |
2 | 2 | [](https://github.com/jayjamesjay/http_req/actions/workflows/rust.yml) |
3 | | -[](https://crates.io/crates/http_req) |
4 | | -[](https://docs.rs/http_req/0.9.3/http_req/) |
| 3 | +[](https://crates.io/crates/http_req) |
| 4 | +[](https://docs.rs/http_req/0.10.0/http_req/) |
5 | 5 |
|
6 | 6 | Simple and lightweight HTTP client with built-in HTTPS support. |
7 | 7 |
|
8 | 8 | ## Requirements |
9 | 9 | http_req by default uses [rust-native-tls](https://github.com/sfackler/rust-native-tls), |
10 | | -which uses TLS framework provided by OS on Windows and macOS, and OpenSSL |
| 10 | +which relies on TLS framework provided by OS on Windows and macOS, and OpenSSL |
11 | 11 | on all other platforms. But it also supports [rus-tls](https://crates.io/crates/rustls). |
12 | 12 |
|
13 | 13 | ## Example |
14 | | -Basic GET request |
| 14 | +Basic HTTP GET request |
15 | 15 | ```rust |
16 | 16 | use http_req::request; |
17 | 17 |
|
18 | 18 | fn main() { |
19 | | - let mut writer = Vec::new(); //container for body of a response |
20 | | - let res = request::get("https://doc.rust-lang.org/", &mut writer).unwrap(); |
| 19 | + let mut body = Vec::new(); //Container for body of a response. |
| 20 | + let res = request::get("https://doc.rust-lang.org/", &mut body).unwrap(); |
21 | 21 |
|
22 | 22 | println!("Status: {} {}", res.status_code(), res.reason()); |
23 | 23 | } |
24 | 24 | ``` |
25 | 25 |
|
| 26 | +Take a look at [more examples](https://github.com/jayjamesjay/http_req/tree/master/examples) |
| 27 | + |
26 | 28 | ## How to use with `rustls`: |
27 | 29 | In order to use `http_req` with `rustls` in your project, add following lines to `Cargo.toml`: |
28 | 30 | ```toml |
29 | 31 | [dependencies] |
30 | | -http_req = {version="^0.9", default-features = false, features = ["rust-tls"]} |
| 32 | +http_req = {version="^0.10", default-features = false, features = ["rust-tls"]} |
31 | 33 | ``` |
32 | 34 |
|
33 | 35 | ## License |
|
0 commit comments