Skip to content

Instantly share code, notes, and snippets.

@amol9 amol9/

Created Feb 23, 2019
What would you like to do?
Rust and http using hyper
extern crate hyper;
use std::io::{self, Write};
use hyper::Client;
use hyper::rt::{self, Future, Stream};
fn main() {
rt::run(rt::lazy(|| {
let client = Client::new();
let uri = "".parse().unwrap();
.and_then(|res| {
println!("Response: {}", res.status());
.for_each(|chunk| {
.map_err(|e| {
panic!("example expects stdout is open, error={}", e)
.map_err(|err| {
println!("Error: {}", err);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.