JcConnectionFactory
public class JcConnectionFactory
Convenience class to intantiate connection based on the ‘JcConnection’ protocol using different authentication strategies
-
Shared instance of this factory class, avoids having to instantiate objects unnecessarily
Declaration
Swift
public static var shared: JcConnectionFactory
-
Defines a connection based on HTTP Basic authentication to be used when calling
JcConnectionRequest
Notes:
This call is stateless and does not manage cookies, sessions etc. This call is simply to allow us to test the credentials, the connection parameters will be resent in every API call.
Declaration
Swift
public func connection(url: URL, authEndpoint: String, user: String, password: String) -> JcSimpleConnection
Parameters
url
Url of API end-point excluding resource and arguments
authEndpoint
resource path that will allows us to test the connection parameters
user
User id to be used to authenticate
password
plain text password to be used to authenticate
Return Value
Connection instance that can be used when calling
JcConnectionRequest