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:
committed by
Sean McArthur
parent
38a47889d9
commit
d5c6f33c34
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user