Protocols
The following protocols are available globally.
-
See moreAPIAuthorization
defines all the properties and methods a class must contain to be used as an authorization for anAPIRequest
.Declaration
Swift
public protocol APIAuthorization
-
Defines the methods required for an object to be returned by an
See moreAPIService
Declaration
Swift
public protocol APIReturnable
-
APIService
defines all the properties and methods a class must contain to be used as a service in anAPIRequest
.A class that conforms to APIService should also define all the endpoints relevent to that service.
An endpoint might look like:
See moreopen class func getUser(byId id: String) -> APIRequest<ReturnType> { return APIRequest<ReturnType>(endpoint: "/users", params: nil, body: ["id": id], method: .GET) }
Declaration
Swift
public protocol APIService