title: std::io::TcpStream::read_as_string returns an empty String
body: <p>I'd like to create a curl-like function in Rust.</p>
  
  <p>So far, here is the code I use:</p>
  
  <pre><code>match Url::parse(url) { 
      Ok(u) =&gt; { 
          match TcpStream::connect(u.host.as_slice(), 80) { 
              Ok(mut socket) =&gt; { 
                  let req = format!(
                      "GET {:s} HTTP/1.1\r\nHost: {:s}\r\nAccept: */*\r\nContent-Length: 0\r\nContent-Type: aplication/x-www-form-urlencoded\r\n",
                      u.path.path.as_slice(), u.host
                  );
                  socket.write(req.as_bytes()); 
                  match socket.read_to_string() {
                      Ok(res) =&gt; println!("{}", res.as_slice()),
                      Err(e) =&gt; fail!("Error: {}", e)
                  };
                  drop(socket);
              },
              Err(e) =&gt; fail!("Error: {}", e)
          };
      },
      Err(e) =&gt; fail!("Error: {}", e)
  };
  </code></pre>
  
  <p>The problem is, if the HTTP request is properly formatted,</p>
  
  <pre><code>println!("{}", res.as_slice())
  </code></pre>
  
  <p>will not display anything, with any url.</p>
  
  <p>If it's not well formatted the same code will display 403 or 400 errors. Is that supposed to mean that the socket var is well populated?</p>
  
  <p>Where could the problem come from? The server or the request?</p>
  
  <p>By the way, the code being a little too long, I'd like to use the macro try! but it raises an error when doing, for instance:</p>
  
  <pre><code>try!(TcpStream::connect(u.host.as_slice(), 80)
  </code></pre>