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
JcConnectionRequestNotes:
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) -> JcSimpleConnectionParameters
urlUrl of API end-point excluding resource and arguments
authEndpointresource path that will allows us to test the connection parameters
userUser id to be used to authenticate
passwordplain text password to be used to authenticate
Return Value
Connection instance that can be used when calling
JcConnectionRequest
View on GitHub
JcConnectionFactory Class Reference