Responsible

public protocol Responsible

The type to conform in order to get URLSessionTask updates

  • Received when URLRequest creation has failed

    Declaration

    Swift

    func didFailToCreateURLRequest(with error: Error)

    Parameters

    error

    Error whihc caused the failure of urlrequest creation

  • Initial response received from request

    Declaration

    Swift

    func didReceiveResponse(dataTask: URLSessionDataTask, response: URLResponse)

    Parameters

    dataTask

    Underlying URLSessionDataTask

    response

    the raw response from the request

  • Data response received as part of the response. This could be called as many times, the data must be appended to get the complete response data

    Declaration

    Swift

    func didReceiveData(_ data: Data)

    Parameters

    data

    The response data

  • The request completion notified. The request could have either succeeded or failed with error

    Declaration

    Swift

    func didCompleteWithError(dataTask: URLSessionTask, error: Error?)

    Parameters

    task

    Underlying URLSessionDataTask

    error

    error what caused the request failure