diff --git a/src/async_impl/request.rs b/src/async_impl/request.rs index cb0b5d3..c6d93f5 100644 --- a/src/async_impl/request.rs +++ b/src/async_impl/request.rs @@ -228,6 +228,19 @@ impl RequestBuilder { } /// Enable HTTP basic authentication. + /// + /// ```rust + /// # use reqwest::Error; + /// + /// # async fn run() -> Result<(), Error> { + /// let client = reqwest::Client::new(); + /// let resp = client.delete("http://httpbin.org/delete") + /// .basic_auth("admin", Some("good password")) + /// .send() + /// .await?; + /// # Ok(()) + /// # } + /// ``` pub fn basic_auth(self, username: U, password: Option
) -> RequestBuilder where U: fmt::Display,