diff --git a/src/api.rs b/src/api.rs index beb7e35..d14ca0d 100644 --- a/src/api.rs +++ b/src/api.rs @@ -28,7 +28,7 @@ pub type Result = std::result::Result>; /// ```rust /// use rabbitmq_http_client::api::ClientBuilder; /// -/// let endpoint = "http://localhost:15672"; +/// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = ClientBuilder::new().with_endpoint(&endpoint).with_basic_auth_credentials(&username, &password).build(); @@ -59,7 +59,7 @@ impl ClientBuilder<&'static str, &'static str, &'static str> { pub fn new() -> Self { let client = HttpClient::new(); Self { - endpoint: "http://localhost:15672", + endpoint: "http://localhost:15672/api", username: "guest", password: "guest", client, @@ -126,7 +126,7 @@ where /// ```rust /// use rabbitmq_http_client::api::Client; /// -/// let endpoint = "http://localhost:15672"; +/// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::new(&endpoint, &username, &password); @@ -156,7 +156,7 @@ where /// ```rust /// use rabbitmq_http_client::api::Client; /// - /// let endpoint = "http://localhost:15672"; + /// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::new(endpoint, username, password); @@ -181,7 +181,7 @@ where /// use rabbitmq_http_client::api::Client; /// /// let client = HttpClient::new(); - /// let endpoint = "http://localhost:15672"; + /// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::from_http_client(client, endpoint, username, password); diff --git a/src/blocking.rs b/src/blocking.rs index 6c89a05..0ac800e 100644 --- a/src/blocking.rs +++ b/src/blocking.rs @@ -29,7 +29,7 @@ pub type Result = std::result::Result>; /// ```rust /// use rabbitmq_http_client::blocking::ClientBuilder; /// -/// let endpoint = "http://localhost:15672"; +/// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = ClientBuilder::new().with_endpoint(&endpoint).with_basic_auth_credentials(&username, &password).build(); @@ -127,7 +127,7 @@ where /// ```rust /// use rabbitmq_http_client::blocking::Client; /// -/// let endpoint = "http://localhost:15672"; +/// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::new(&endpoint, &username, &password); @@ -157,7 +157,7 @@ where /// ```rust /// use rabbitmq_http_client::blocking::Client; /// - /// let endpoint = "http://localhost:15672"; + /// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::new(endpoint, username, password); @@ -182,7 +182,7 @@ where /// use rabbitmq_http_client::blocking::Client; /// /// let client = HttpClient::new(); - /// let endpoint = "http://localhost:15672"; + /// let endpoint = "http://localhost:15672/api"; /// let username = "username"; /// let password = "password"; /// let rc = Client::from_http_client(client, endpoint, username, password); @@ -1147,13 +1147,13 @@ where where S: AsRef, { - format!("{}/api/{}", self.endpoint, path.as_ref()) + format!("{}/{}", self.endpoint, path.as_ref()) } } impl Default for Client<&'static str, &'static str, &'static str> { fn default() -> Self { - Self::new("http://localhost:15672", "guest", "guest") + Self::new("http://localhost:15672/api", "guest", "guest") } } diff --git a/tests/common.rs b/tests/common.rs index 8a3c527..3c30f57 100644 --- a/tests/common.rs +++ b/tests/common.rs @@ -1,7 +1,7 @@ use std::env; use std::time::Duration; -pub const ENDPOINT: &str = "http://localhost:15672"; +pub const ENDPOINT: &str = "http://localhost:15672/api"; pub const USERNAME: &str = "guest"; pub const PASSWORD: &str = "guest";