Created
June 20, 2016 23:20
-
-
Save febuiles/997d177a1bc1702b26e3ea895967ac3d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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