DataResponseSerializer

public struct DataResponseSerializer<Value>: DataResponseSerializerProtocol

A generic DataResponseSerializerType used to serialize a request, response, and data into a serialized object.

  • A closure used by response handlers that takes a request, response, data and error and returns a result.

    Declaration

    Swift

    public var serializeResponse: (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<Value>
  • The type of serialized object to be created by this DataResponseSerializer.

    Declaration

    Swift

    public typealias SerializedObject = Value
  • Initializes the ResponseSerializer instance with the given serialize response closure.

    Declaration

    Swift

    public init(serializeResponse: @escaping (URLRequest?, HTTPURLResponse?, Data?, Error?) -> Result<Value>)