Skip to content

Instantly share code, notes, and snippets.

@febuiles
Created June 20, 2016 23:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save febuiles/997d177a1bc1702b26e3ea895967ac3d to your computer and use it in GitHub Desktop.
Save febuiles/997d177a1bc1702b26e3ea895967ac3d to your computer and use it in GitHub Desktop.
extern crate hyper;
use std::io::Read;
fn main() {
let client = hyper::Client::new();
let mut res = client.get("http://2fe5e2b9.ngrok.io/server-info").send().unwrap();
let mut s = String::new();
res.read_to_string(&mut s).unwrap();
println!("{}", s);
}
// cargo run
// Running `/Users/federico/dev/mlove/target/debug/mlove`
// thread '<main>' panicked at 'called `Result::unwrap()` on an `Err` value: Error { repr: Custom(Custom { kind: InvalidData, error: StringError("stream did not contain valid UTF-8") }) }', src/libcore/result.rs:746
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment