StreamUploadable
public protocol StreamUploadable: AStreamUploadable, Uploadable
Represents a StreamUploadable
for Restofire.
Create custom StreamUploadable
protocol HTTPBinUploadService: StreamUploadable {
var path: String? = "post"
var stream: InputStream = InputStream(url: FileManager.imageURL)!
}
-
response(_:)
Extension methodCreates a
UploadOperation
for the specifiedUploadable
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
.