-
Undocumented
Declaration
Swift
public typealias RequestCompletion<ResponseType> = (HTTPURLResponse?, Result<ResponseType, Error>) -> Void
-
Undocumented
Declaration
Swift
public lazy var sessionCache: SessionCache { get set }
-
Undocumented
Declaration
Swift
public let configuration: Configuration
-
Undocumented
Declaration
Swift
public let session: URLSession
-
Initialises a new client instance with a default url session.
Declaration
Swift
public init( configuration: Configuration, session: URLSession = .init(configuration: .default) )
Parameters
configuration
The client configuration.
session
The URLSession which is used for executing requests
-
Undocumented
Declaration
Swift
@discardableResult public func get<ResponseType: Decodable>( endpoint: Endpoint<ResponseType>, andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func post<BodyType: Encodable, ResponseType: Decodable>( endpoint: Endpoint<ResponseType>, body: BodyType, andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func post<ResponseType>( endpoint: Endpoint<ResponseType>, body: ExpressibleByNilLiteral? = nil, andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func put<BodyType: Encodable, ResponseType: Decodable>( endpoint: Endpoint<ResponseType>, body: BodyType, andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func patch<BodyType: Encodable, ResponseType: Decodable>( endpoint: Endpoint<ResponseType>, body: BodyType, andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func delete<ResponseType: Decodable>( endpoint: Endpoint<ResponseType>, parameter: [String: Any] = [:], andAdditionalHeaderFields additionalHeaderFields: [String: String] = [:], _ completion: @escaping RequestCompletion<ResponseType> ) -> CancellableRequest?
-
Undocumented
Declaration
Swift
@discardableResult public func send(request: URLRequest, _ completion: @escaping (Data?, URLResponse?, Error?) -> Void) -> CancellableRequest?
-
Perform something on the configuration’s response queue.
Declaration
Swift
public func enqueue(_ completion: @autoclosure @escaping () -> Void)