pub fn basic_auth<N>(self, username: N, password: Option<&str>) -> Self
    where
        N: fmt::Display,
    {
        let auth = match password {
            Some(password) => format!("{}:{}", username, password),
            None => format!("{}:", username),
        };
        self.header(
            header::AUTHORIZATION,
            format!("Basic {}", base64::encode(&auth)),
        )
    }
/// Set client wide HTTP basic authorization header
Set client wide HTTP basic authorization header
Set client wide HTTP basic authorization header
pub fn basic_auth<N>(self, username: N, password: Option<&str>) -> Self
    where
        N: fmt::Display,
    {
        let auth = match password {
            Some(password) => format!("{}:{}", username, password),
            None => format!("{}:", username),
        };
        self.header(
            header::AUTHORIZATION,
            format!("Basic {}", base64::encode(&auth)),
        )
    }
pub fn basic_auth < N > ( self , username : N , password : Option < & str > ) -> Self where N : fmt :: Display , { let auth = match password { Some ( password ) => format ! ( " " username password ) , None => format ! ( " " username ) , } ; self . header ( header :: AUTHORIZATION , format ! ( " " base64 encode ( auth ) ) , ) }
Set client wide HTTP basic authorization header
Set client wide HTTP basic authorization header
self
username
N
password
Option<&str>
self
username
N
password
Option<&str>