Skip to content

Commit

Permalink
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/async_impl/request.rs
Original file line number Diff line number Diff line change
@@ -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<U, P>(self, username: U, password: Option<P>) -> RequestBuilder
where
U: fmt::Display,

0 comments on commit be8ab7b

Please sign in to comment.