FileUploadable

public protocol FileUploadable: AFileUploadable, Uploadable

Represents a FileUploadable for Restofire.

Create custom FileUploadable

protocol HTTPBinUploadService: FileUploadable {

    var path: String? = "post"
    let url: URL = FileManager.url(forResource: "rainbow", withExtension: "jpg")

}
  • response(_:) Extension method

    Creates a UploadOperation for the specified Uploadable object and asynchronously executes it.

    Declaration

    Swift

    public func response(_ completionHandler: ((DataResponse<Response>) -> Void)? = nil) -> UploadOperation<Self>

    Parameters

    completionHandler

    A closure to be executed once the download has finished. nil by default.

    Return Value

    The created UploadOperation.