diff --git a/src/client.rs b/src/client.rs index ae1cfb4..c4f736c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -175,6 +175,14 @@ impl RequestBuilder { self } + /// Enable HTTP basic authentication. + pub fn basic_auth(self, username: String, password: Option) -> RequestBuilder { + self.header(::header::Authorization(::header::Basic{ + username: username, + password: password, + })) + } + /// Set the request body. pub fn body>(mut self, body: T) -> RequestBuilder { self.body = Some(Ok(body.into()));