Struct typed_headers::Authorization[][src]

pub struct Authorization(pub Credentials);

Authorization header, defined in RFC7235

The Authorization header field allows a user agent to authenticate itself with an origin server -- usually, but not necessarily, after receiving a 401 (Unauthorized) response. Its value consists of credentials containing the authentication information of the user agent for the realm of the resource being requested.

ABNF

Authorization = credentials

Example values

  • Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==
  • Bearer fpKL54jvWmEGVoRdCNjG

Methods from Deref<Target = Credentials>

Returns the auth-scheme associated with the credentials.

Returns the token68 value associated with the credentials if present.

Returns the bearer token if this contains Bearer credentials.

Trait Implementations

impl Clone for Authorization
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Authorization
[src]

Formats the value using the given formatter. Read more

impl PartialEq for Authorization
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Deref for Authorization
[src]

The resulting type after dereferencing.

Dereferences the value.

impl DerefMut for Authorization
[src]

Mutably dereferences the value.

impl Header for Authorization
[src]

Returns the name of this header. Read more

Parses the header from the raw value bytes. Read more

Serializes the header to raw values. Read more

Auto Trait Implementations