diff --git a/src/lib.rs b/src/lib.rs index cb86b9c..3d3ae1e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -179,7 +179,11 @@ pub fn agent() -> Agent { /// Make a request setting the HTTP method via a string. /// /// ``` -/// ureq::request("GET", "http://example.com").call().unwrap(); +/// # fn main() -> Result<(), ureq::Error> { +/// # ureq::is_test(true); +/// ureq::request("GET", "http://example.com").call()?; +/// # Ok(()) +/// # } /// ``` pub fn request(method: &str, path: &str) -> Request { agent().request(method, path) diff --git a/src/request.rs b/src/request.rs index 260b420..02482ac 100644 --- a/src/request.rs +++ b/src/request.rs @@ -60,16 +60,10 @@ impl Request { /// Executes the request and blocks the caller until done. /// - /// Use `.timeout_connect()` and `.timeout_read()` to avoid blocking forever. - /// /// ``` - /// use std::time::Duration; /// # fn main() -> Result<(), ureq::Error> { /// # ureq::is_test(true); - /// let resp = ureq::builder() - /// .timeout_connect(Duration::from_secs(10)) - /// .build() - /// .get("http://example.com/") + /// let resp = ureq::get("http://example.com/") /// .call()?; /// # Ok(()) /// # }