diff --git a/README.md b/README.md index ee22cbd..fef61ca 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,21 @@ # reqwest -An ergonomic HTTP Client for Rust +[![Travis CI Status](https://travis-ci.org/seanmonstar/reqwest.svg?branch=master) +[![crates.io](https://img.shields.io/crates/v/reqwest.svg)](https://crates.io/crates/reqwest) +An ergonomic HTTP Client for Rust. +Built on top of [hyper](http://hyper.rs), with a batteries-included mindset. + +- [Documentation](https://docs.rs/reqwest) + +## License + +Licensed under either of + +- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://apache.org/licenses/LICENSE-2.0) +- MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) + +### Contribution + +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. diff --git a/src/client.rs b/src/client.rs index cfc52d6..b3d675f 100644 --- a/src/client.rs +++ b/src/client.rs @@ -69,12 +69,6 @@ impl Client { } } -#[cfg(not(feature = "tls"))] -fn new_hyper_client() -> ::Result<::hyper::Client> { - Ok(::hyper::Client::new()) -} - -#[cfg(feature = "tls")] fn new_hyper_client() -> ::Result<::hyper::Client> { use tls::TlsClient; Ok(::hyper::Client::with_connector( diff --git a/src/lib.rs b/src/lib.rs index 1edab19..b62de34 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -91,12 +91,13 @@ extern crate hyper; #[macro_use] extern crate log; -#[cfg(feature = "tls")] extern crate native_tls; +extern crate native_tls; extern crate serde; extern crate serde_json; extern crate serde_urlencoded; extern crate url; +pub use hyper::client::IntoUrl; pub use hyper::header; pub use hyper::method::Method; pub use hyper::status::StatusCode; @@ -111,11 +112,11 @@ pub use self::body::Body; mod body; mod client; mod error; +mod tls; -#[cfg(feature = "tls")] mod tls; /// Shortcut method to quickly make a `GET` request. -pub fn get(url: &str) -> ::Result { +pub fn get(url: T) -> ::Result { let client = try!(Client::new()); client.get(url).send() }