You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
externcrate hyper;externcrate env_logger;use std::io::Read;use hyper::Client;use hyper::header::Connection;fnmain(){
env_logger::init().unwrap();// Create a client.letmut client = Client::new();// Creating an outgoing request.letmut res = client.get("http://promodj.com/taga/rss.xml")// set a header// .header(Connection::close())// let 'er go!.send().unwrap();// Read the Response.letmut body = String::new();
res.read_to_string(&mut body).unwrap();println!("Response: {}", body);}
I'm not sure if this is bug in hyper or the server misbehaving (I don't control the server). I note that curl downloads the full response even when the Connection: close header is specified via -H "Connection: close".
The text was updated successfully, but these errors were encountered:
Sample program that reads entire response:
Running this gives the following trace: https://gist.github.com/wezm/962eb2c7b16b908256f3
Uncommenting the
Connection::close
line gives the following: https://gist.github.com/wezm/3942e9d33add01c789a2I'm not sure if this is bug in hyper or the server misbehaving (I don't control the server). I note that curl downloads the full response even when the
Connection: close
header is specified via-H "Connection: close"
.The text was updated successfully, but these errors were encountered: