Skip to content

Commit 32197f7

Browse files
committed
add feature list to readme
1 parent c5b411a commit 32197f7

File tree

2 files changed

+36
-22
lines changed

2 files changed

+36
-22
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 34 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,29 @@
66

77
Simple and lightweight HTTP client with built-in HTTPS support.
88

9-
- HTTP and HTTPS via [rust-native-tls](https://github.com/sfackler/rust-native-tls) (or optionally [rus-tls](https://crates.io/crates/rustls))
9+
- HTTP and HTTPS via [rust-native-tls](https://crates.io/crates/native-tls) (or optionally [rustls](https://crates.io/crates/rustls))
1010
- Small binary size (0.7 MB for a basic GET request in the default configuratio)
1111
- Minimal number of dependencies
1212

1313
## Requirements
1414

15-
http_req by default uses [rust-native-tls](https://github.com/sfackler/rust-native-tls),
15+
http_req by default uses [rust-native-tls](https://crates.io/crates/native-tls),
1616
which relies on TLS framework provided by OS on Windows and macOS, and OpenSSL
17-
on all other platforms. But it also supports [rus-tls](https://crates.io/crates/rustls).
18-
19-
## Example
20-
21-
Basic HTTP GET request
22-
23-
```rust
24-
use http_req::request;
25-
26-
fn main() {
27-
let mut body = Vec::new(); //Container for body of a response.
28-
let res = request::get("https://doc.rust-lang.org/", &mut body).unwrap();
29-
30-
println!("Status: {} {}", res.status_code(), res.reason());
31-
}
32-
```
33-
34-
Take a look at [more examples](https://github.com/jayjamesjay/http_req/tree/master/examples)
17+
on all other platforms. But it also supports [rustls](https://crates.io/crates/rustls).
18+
19+
## Features
20+
21+
- Support for both HTTP and HTTPS protocols via [rust-native-tls](https://crates.io/crates/native-tls) (or optionally [rustls](https://crates.io/crates/rustls))
22+
- Creating and sending HTTP requests using the `Request` type (with extended capabilities provided via `RequestMessage` and `Stream`)
23+
- Representing HTTP responses with the `Response` type, allowing easy access to details like the status code and headers
24+
- Handling redirects using the `RedirectPolicy`
25+
- Support for Basic and Bearer authentication
26+
- Processing responses with `Transfer-Encoding: chunked`
27+
- Managing absolute `Uri`s and partial support for relative `Uri`s
28+
- Enforcing timeouts on requests
29+
- Downloading data in a streaming fashion, allowing direct saving to disk (minimizing RAM usage)
30+
- `Error` handling system allowing for better debugging
31+
- Utility functions for easily sending common request types: `get`, `head`, `post`
3532

3633
## Usage
3734

@@ -53,6 +50,23 @@ In order to use `http_req` with `rustls` in your project, add the following line
5350
http_req = { version="^0.14", default-features = false, features = ["rust-tls"] }
5451
```
5552

53+
## Example
54+
55+
Basic HTTP GET request
56+
57+
```rust
58+
use http_req::request;
59+
60+
fn main() {
61+
let mut body = Vec::new(); //Container for body of a response.
62+
let res = request::get("https://doc.rust-lang.org/", &mut body).unwrap();
63+
64+
println!("Status: {} {}", res.status_code(), res.reason());
65+
}
66+
```
67+
68+
Take a look at [more examples](https://github.com/jayjamesjay/http_req/tree/master/examples)
69+
5670
## License
5771

5872
Licensed under [MIT](https://github.com/jayjamesjay/http_req/blob/master/LICENSE).

0 commit comments

Comments
 (0)