Skip to content

Instantly share code, notes, and snippets.

Created October 10, 2016 10:10
Show Gist options
  • Save anonymous/7725d2a56512678ce0c31ed992d5a17c to your computer and use it in GitHub Desktop.
Save anonymous/7725d2a56512678ce0c31ed992d5a17c to your computer and use it in GitHub Desktop.
Shared via Rust Playground
let request_url = "https://some.api/path.json"
let client = Client::new();
let mut res = client.get(&request_url).send().unwrap();
assert_eq!(res.status, hyper::Ok);
println!("Reading body..");
let mut res_body = String::new();
let result = res.read_to_string(&mut res_body).unwrap();
println!("Done");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment