DownloadRequest
Undocumented
-
Creates a response serializer that returns a JSON Decodable object result type constructed from the response data using
JSONDecoder
with the specified reading options.Declaration
Swift
public static func JSONDecodableResponseSerializer<T: Decodable>( decoder: JSONDecoder = JSONDecoder()) -> DownloadResponseSerializer<T>
Parameters
decoder
The JSONDecoder opject. Defaults to
JSONDecoder()
.Return Value
A JSON Decodable object response serializer.
-
Adds a handler to be called once the request has finished.
Declaration
Swift
public func responseJSONDecodable<T: Decodable>( queue: DispatchQueue? = nil, decoder: JSONDecoder = JSONDecoder(), completionHandler: @escaping (DownloadResponse<T>) -> Void) -> Self
Parameters
decoder
The JSONDecoder opject. Defaults to
JSONDecoder()
.completionHandler
A closure to be executed once the request has finished.
Return Value
The request.