Streaming HTTP with any package?


I’ve spent 3-5 hours messing with Twitter API and now I want to use their streaming API.

So far I’ve been able to OAuth and successfully pull data, but sadly, that data is just an empty string.

I’m assuming this is because I’m not waiting long enough for new data - or rather not waiting at all!

Currently I’m using Reqwest, and would prefer if someone answered using it, but if not Hyper is acceptable too.

Thank you very much!

Here is the code I’m using:

extern crate reqwest;
extern crate oauth_client as oauth;

use std::collections::HashMap;

use oauth::{

use reqwest::{

use reqwest::header::{

const CONSUMER_KEY: &str = "";
const CONSUMER_SECRET: &str = "";

const ACCESS_TOKEN: &str = "";
const ACCESS_TOKEN_SECRET: &str = "";

fn main() {

fn query_twitter() -> () {
  let query_url = format!(

  let consumer_token = Some(Token::new(CONSUMER_KEY, CONSUMER_SECRET));
  let access_token   = Some(Token::new(ACCESS_TOKEN, ACCESS_TOKEN_SECRET));

  let mut req_param = HashMap::new();
  req_param.insert("track".into(), "donald".into());

  let (oauth_header, body) = oauth::authorization_header(
  let mut res = Client

  loop {
    println!("{:?}", res.text());


I have broadened my requirements. Help! :persevere:


Looks like someone has already wrapped this: