Add some more updates.

This commit is contained in:
Jacob Hoffman-Andrews
2020-11-14 16:49:44 -08:00
committed by Martin Algesten
parent daa63d3bc6
commit 26145810bf
2 changed files with 6 additions and 8 deletions

View File

@@ -179,7 +179,11 @@ pub fn agent() -> Agent {
/// Make a request setting the HTTP method via a string. /// 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 { pub fn request(method: &str, path: &str) -> Request {
agent().request(method, path) agent().request(method, path)

View File

@@ -60,16 +60,10 @@ impl Request {
/// Executes the request and blocks the caller until done. /// 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> { /// # fn main() -> Result<(), ureq::Error> {
/// # ureq::is_test(true); /// # ureq::is_test(true);
/// let resp = ureq::builder() /// let resp = ureq::get("http://example.com/")
/// .timeout_connect(Duration::from_secs(10))
/// .build()
/// .get("http://example.com/")
/// .call()?; /// .call()?;
/// # Ok(()) /// # Ok(())
/// # } /// # }