Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use hyper::header::{Headers, Authorization, Basic}
- let mut headers = Headers::new();
- // if request need to be authorized
- if let Some(auth) = req.auth {
- headers.set(
- Authorization(
- Basic {
- username: auth.username.to_string(),
- password: Some(auth.password.to_string())
- }
- )
- );
- }
Add Comment
Please, Sign In to add comment