MultipartUploadable
public protocol MultipartUploadable: AMultipartUploadable, Uploadable
Represents a MultipartUploadable
for Restofire.
Create custom MultipartUploadable
protocol HTTPBinUploadService: MultipartUploadable {
var path: String? = "post"
var multipartFormData: (MultipartFormData) -> Void = { multipartFormData in
multipartFormData.append("français".data(using: .utf8)!, withName: "french")
multipartFormData.append("日本語".data(using: .utf8)!, withName: "japanese")
}
}
-
response(request:completionHandler:)
Extension methodCreates a
UploadOperation
for the specifiedUploadable
object and asynchronously executes it.Declaration
Swift
public func response(request: UploadRequest, completionHandler: ((DataResponse<Response>) -> Void)? = nil) -> UploadOperation<Self>
Parameters
request
An
Alamofire.UploadRequest
.completionHandler
A closure to be executed once the download has finished.
nil
by default.Return Value
The created
UploadOperation
.