AnyResponseSerializer
public class AnyResponseSerializer<Value> : ResponseSerializer
Undocumented
-
A closure which can be used to serialize data responses.
Declaration
Swift
public typealias DataSerializer = (_ request: URLRequest?, _ response: HTTPURLResponse?, _ data: Data?, _ error: Error?) throws -> Value -
A closure which can be used to serialize download reponses.
Declaration
Swift
public typealias DownloadSerializer = (_ request: URLRequest?, _ response: HTTPURLResponse?, _ fileURL: URL?, _ error: Error?) throws -> Value -
Initializes the
ResponseSerializerinstance with the given serialize response closure.Declaration
Swift
public init(dataSerializer: @escaping DataSerializer, downloadSerializer: @escaping DownloadSerializer)Parameters
dataSerializerA
DataSerializerclosure.downloadSerializerA
DownloadSerializerclosure. -
Initialze the instance with a
DataSerializerclosure. Download serialization will fallback to a default implementation.Declaration
Swift
public init(dataSerializer: @escaping DataSerializer)Parameters
dataSerializerA
DataSerializerclosure. -
Undocumented
Declaration
Swift
public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> Value -
Undocumented
Declaration
Swift
public func serializeDownload(request: URLRequest?, response: HTTPURLResponse?, fileURL: URL?, error: Error?) throws -> Value
AnyResponseSerializer Class Reference