Add some more updates.
This commit is contained in:
committed by
Martin Algesten
parent
daa63d3bc6
commit
26145810bf
@@ -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)
|
||||||
|
|||||||
@@ -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(())
|
||||||
/// # }
|
/// # }
|
||||||
|
|||||||
Reference in New Issue
Block a user