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
username
The username of the credential.
password
The 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
Authorization
of an HTTP basic authentication.Declaration
Swift
public func authString() -> String
Return Value
The encoded authentication string.