Struct http_types::auth::Authorization [−][src]
pub struct Authorization { /* fields omitted */ }
Expand description
Credentials to authenticate a user agent with a server.
Specifications
Examples
use http_types::Response; use http_types::auth::{AuthenticationScheme, Authorization}; let scheme = AuthenticationScheme::Basic; let credentials = "0xdeadbeef202020"; let authz = Authorization::new(scheme, credentials.into()); let mut res = Response::new(200); authz.apply(&mut res); let authz = Authorization::from_headers(res)?.unwrap(); assert_eq!(authz.scheme(), AuthenticationScheme::Basic); assert_eq!(authz.credentials(), credentials);
Implementations
Create a new instance of Authorization
.
Create a new instance from headers.
Get the HeaderName
.
Get the HeaderValue
.
Get the authorization scheme.
Set the authorization scheme.
Get the authorization credentials.
Set the authorization credentials.