Add more details to README
This commit is contained in:
38
README.md
38
README.md
@@ -3,14 +3,30 @@
|
||||
[](https://travis-ci.org/seanmonstar/reqwest)
|
||||
[](https://ci.appveyor.com/project/seanmonstar/reqwest)
|
||||
[](https://crates.io/crates/reqwest)
|
||||
[](https://docs.rs/reqwest)
|
||||
|
||||
An ergonomic HTTP Client for Rust.
|
||||
An ergonomic, batteries-included HTTP Client for Rust.
|
||||
|
||||
Built on top of [hyper](http://hyper.rs), with a batteries-included mindset.
|
||||
|
||||
- [Documentation](https://docs.rs/reqwest)
|
||||
- Plain bodies, JSON, urlencoded, multipart
|
||||
- Customizable redirect policy
|
||||
- HTTP Proxies
|
||||
- HTTPS via system-native TLS (or optionally, rustls)
|
||||
- [Changelog](CHANGELOG.md)
|
||||
|
||||
## Example
|
||||
|
||||
```rust
|
||||
extern crate reqwest;
|
||||
|
||||
use std::collections::HashMap;
|
||||
|
||||
fn main() -> Result<(), Box<std::error::Error> {
|
||||
let res: HashMap<String, String> = reqwest::get("https://httpbin.org/ip")?
|
||||
.json()?;
|
||||
println!("{:#?}", resp);
|
||||
}
|
||||
```
|
||||
|
||||
## Requirements
|
||||
|
||||
On Linux:
|
||||
@@ -23,20 +39,6 @@ On Windows and macOS:
|
||||
|
||||
Reqwest uses [rust-native-tls](https://github.com/sfackler/rust-native-tls), which will use the operating system TLS framework if available, meaning Windows and macOS. On Linux, it will use OpenSSL 1.1.
|
||||
|
||||
## Example
|
||||
|
||||
Fetch json
|
||||
|
||||
```rust
|
||||
extern crate reqwest;
|
||||
#[macro_use] extern crate serde_json;
|
||||
|
||||
fn main() {
|
||||
let mut reqwest_responce = reqwest::get("https://jsonplaceholder.typicode.com/todos/1").unwrap();
|
||||
let jsonplaceholder: serde_json::Value = reqwest_responce.json().unwrap();
|
||||
println!("{:#?}", jsonplaceholder);
|
||||
}
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
|
||||
Reference in New Issue
Block a user