Guest User

Untitled

a guest
Jun 7th, 2018
251
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.44 KB | None | 0 0
  1. use hyper::header::{Headers, Authorization, Basic}
  2.  
  3. let mut headers = Headers::new();
  4. // if request need to be authorized
  5. if let Some(auth) = req.auth {
  6. headers.set(
  7. Authorization(
  8. Basic {
  9. username: auth.username.to_string(),
  10. password: Some(auth.password.to_string())
  11. }
  12. )
  13. );
  14. }
Add Comment
Please, Sign In to add comment