Structures
The following structures are available globally.
-
An Authentication for RESTful Services.
See morevar authentication = Authentication() authentication.credential = URLCredential( user: "user", password: "password", persistence: .forSession )
Declaration
Swift
public struct Authentication
-
A Configuration for RESTful Services. You must provide a
host
.
See morevar configuration = Configuration() configuration.scheme: String = "https" configuration.baseURL = "www.mocky.io" configuration.version = "v2" configuration.headers = ["Content-Type": "application/json"]
Declaration
Swift
public struct Configuration
-
Declaration
Swift
public struct Poll
-
A Queues for RESTful Services.
See morevar queues = Queues() queues.completionQueue = DispatchQueue.main
Declaration
Swift
public struct Queues
-
A Reachability for RESTful Services.
See morevar reachability = Reachability() reachability.eventually = true reachability.networkReachabilityManager = NetworkReachabilityManager()!
Declaration
Swift
public struct Reachability
-
A Retry for RESTful Services.
See morevar retry = Retry() retry.retryErrorCodes = [.timedOut,.networkConnectionLost] retry.retryInterval = 20 retry.maxRetryAttempts = 10
Declaration
Swift
public struct Retry
-
A Session for RESTful Services.
See moreSession.default.session = { let sessionConfiguration = URLSessionConfiguration.default sessionConfiguration.timeoutIntervalForRequest = 7 sessionConfiguration.timeoutIntervalForResource = 7 sessionConfiguration.HTTPAdditionalHeaders = Manager.defaultHTTPHeaders return Session(configuration: sessionConfiguration) }
Declaration
Swift
public struct SessionManager
-
A Validation for RESTful Services.
See morevar validation = Validation() validation.acceptableStatusCodes = Array(200..<300) validation.acceptableContentTypes = ["application/json"]
Declaration
Swift
public struct Validation