dont require agent().build()
This commit is contained in:
@@ -17,7 +17,7 @@ include!("unit.rs");
|
||||
/// can keep a state.
|
||||
///
|
||||
/// ```
|
||||
/// let agent = ureq::agent().build();
|
||||
/// let agent = ureq::agent();
|
||||
///
|
||||
/// let auth = agent
|
||||
/// .post("/login")
|
||||
@@ -222,7 +222,7 @@ impl Agent {
|
||||
/// that `Set-Cookie` in the agent.
|
||||
///
|
||||
/// ```
|
||||
/// let agent = ureq::agent().build();
|
||||
/// let agent = ureq::agent();
|
||||
///
|
||||
/// agent.get("http://www.google.com").call();
|
||||
///
|
||||
@@ -239,7 +239,7 @@ impl Agent {
|
||||
/// Set a cookie in this agent.
|
||||
///
|
||||
/// ```
|
||||
/// let agent = ureq::agent().build();
|
||||
/// let agent = ureq::agent();
|
||||
///
|
||||
/// let cookie = ureq::Cookie::new("name", "value");
|
||||
/// agent.set_cookie(cookie);
|
||||
|
||||
@@ -133,7 +133,7 @@ pub use serde_json::{to_value as serde_to_value, Map as SerdeMap, Value as Serde
|
||||
|
||||
/// Agents are used to keep state between requests.
|
||||
pub fn agent() -> Agent {
|
||||
Agent::new()
|
||||
Agent::new().build()
|
||||
}
|
||||
|
||||
/// Make a request setting the HTTP method via a string.
|
||||
|
||||
@@ -27,7 +27,7 @@ fn agent_reuse_headers() {
|
||||
|
||||
#[test]
|
||||
fn agent_cookies() {
|
||||
let agent = agent().build();
|
||||
let agent = agent();
|
||||
|
||||
test::set_handler("/agent_cookies", |_unit| {
|
||||
test::make_response(
|
||||
|
||||
@@ -20,7 +20,7 @@ fn read_range() {
|
||||
|
||||
#[test]
|
||||
fn agent_pool() {
|
||||
let agent = agent().build();
|
||||
let agent = agent();
|
||||
|
||||
// req 1
|
||||
let resp = agent.get("https://s3.amazonaws.com/foosrvr/bbb.mp4")
|
||||
|
||||
Reference in New Issue
Block a user