Update the client API to statically track headers and move constructors

The client Request now uses the same system as a server Response to track
the write status of headers, and the API has been updated accordingly.

Additionally, the Request constructors have been moved onto the Request object
instead of being top-level hyper functions, as this better namespaces the
client and Server.
This commit is contained in:
Jonathan Reem
2014-09-10 12:34:05 -07:00
committed by Sean McArthur
parent 38a47889d9
commit d5c6f33c34
6 changed files with 100 additions and 73 deletions

View File

@@ -13,8 +13,8 @@ use http::server::Server;
static phrase: &'static [u8] = b"Benchmarking hyper vs others!";
fn request(url: hyper::Url) {
let req = hyper::get(url).unwrap();
req.send().unwrap().read_to_string().unwrap();
let req = hyper::client::Request::get(url).unwrap();
req.start().unwrap().send().unwrap().read_to_string().unwrap();
}
fn hyper_handle(mut incoming: hyper::server::Incoming) {