URLResponseCapable

public protocol URLResponseCapable

Protocol requirements for all types that can transform data into a specified type.

This is used to especify how parse the response of a http request.

  • A type representing the output of the parsing operation

    Declaration

    Swift

    associatedtype ResponseType
  • The Data parsing function that tries to transform Data into a the corresponding associated type

    This function can fail by throwing an error that will propagate when executing a request.

    Declaration

    Swift

    func handle(data: Data) throws -> ResponseType