Add json fetch example to readme (#438)

Closes #428
This commit is contained in:
Ben
2019-01-15 05:07:04 +09:00
committed by Sean McArthur
parent 10c0e64711
commit 68a4a3e63e

View File

@@ -23,6 +23,21 @@ 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
Licensed under either of