Add tiny example to Client

This commit is contained in:
Raphaël Huchet
2017-05-15 16:01:24 +02:00
committed by GitHub
parent cd640417db
commit 0b5ba9aaa7

View File

@@ -28,6 +28,23 @@ static DEFAULT_USER_AGENT: &'static str = concat!(env!("CARGO_PKG_NAME"), "/", e
///
/// The `Client` holds a connection pool internally, so it is advised that
/// you create one and reuse it.
///
/// # Examples
///
/// ```no_run
/// extern crate reqwest;
///
/// use reqwest::{Error, Client};
///
/// fn run() -> Result<(), Error> {
/// Client::new()?.get("http://httpbin.org/").send()?;
/// Ok(())
/// }
///
/// fn main() {
/// run().unwrap();
/// }
/// ```
#[derive(Clone)]
pub struct Client {
inner: Arc<ClientRef>,