HTTPAuthentication
public struct HTTPAuthentication
The helper wrapping up an HTTP basic authentication credential.
-
The username of the credential.
Declaration
Swift
public let username: String -
The password of the credential.
Declaration
Swift
public let password: String -
Initailize the credential with username and password.
Declaration
Swift
public init(username: String, password: String)Parameters
usernameThe username of the credential.
passwordThe password of the credential.
Return Value
The credential.
-
Return the base64 encoded string of the credential.
Declaration
Swift
public func encoding() -> String?Return Value
The credential encoded with
"\(username):\(password)" -
Return the full header field content for
Authorizationof an HTTP basic authentication.Declaration
Swift
public func authString() -> StringReturn Value
The encoded authentication string.
View on GitHub
HTTPAuthentication Struct Reference