Struct http_types::auth::BasicAuth [−][src]
pub struct BasicAuth { /* fields omitted */ }
Expand description
HTTP Basic authorization.
Specifications
Examples
use http_types::Response; use http_types::auth::{AuthenticationScheme, BasicAuth}; let username = "nori"; let password = "secret_fish!!"; let authz = BasicAuth::new(username, password); let mut res = Response::new(200); authz.apply(&mut res); let authz = BasicAuth::from_headers(res)?.unwrap(); assert_eq!(authz.username(), username); assert_eq!(authz.password(), password);
Implementations
Create a new instance of BasicAuth
.
Create a new instance from headers.
Create a new instance from the base64 encoded credentials.
Get the HeaderName
.
Get the HeaderValue
.