Uploadable
public protocol Uploadable : BaseRequestable
Represents an abstract Uploadable.
Instead implement FileUploadable, DataUploadable, StreamUploadable, AMultipartUplodable protocols.
-
validationBlockDefault implementationThe Alamofire upload request validation.
Default Implementation
Validation.default.uploadValidationDeclaration
Swift
var validationBlock: DataRequest.Validation? { get } -
The uplaod request for subclasses to provide the implementation.
Declaration
Swift
func asRequest<T>(parametersType: ParametersType<T>) throws -> () -> UploadRequest where T : Encodable -
request(_:didCompleteWithValue:)Default implementationCalled when the Request succeeds.
Default Implementation
Does NothingDeclaration
Swift
func request(_ request: UploadOperation<Self>, didCompleteWithValue value: Response)Parameters
requestThe Alamofire.UploadRequest
valueThe Response
-
request(_:didFailWithError:)Default implementationCalled when the Request fails
Default Implementation
Does NothingDeclaration
Swift
func request(_ request: UploadOperation<Self>, didFailWithError error: Error)Parameters
requestThe Alamofire.UploadRequest
errorThe Error
-
methodExtension method.postDeclaration
Swift
public var method: HTTPMethod { get } -
Creates a
UploadOperationfor the specifiedUploadableobject.Declaration
Swift
@discardableResult public func operation( parameters: Any? = nil, uploadProgressHandler: ((Progress) -> Void, queue: DispatchQueue?)? = nil, completionQueue: DispatchQueue = .main, completionHandler: ((DataResponse<Response>) -> Void)? = nil ) throws -> UploadOperation<Self>Parameters
uploadProgressHandlerA closure to be executed once the upload progresses.
nilby default.completionHandlerA closure to be executed once the request has finished.
nilby default.Return Value
The created
UploadOperation. -
Creates a
UploadOperationfor the specifiedUploadableobject and asynchronously executes it.Declaration
Swift
@discardableResult public func enqueue( parameters: Any? = nil, uploadProgressHandler: ((Progress) -> Void, queue: DispatchQueue?)? = nil, completionQueue: DispatchQueue = .main, completionHandler: ((DataResponse<Response>) -> Void)? = nil ) throws -> CancellableParameters
uploadProgressHandlerA closure to be executed once the upload progresses.
nilby default.completionHandlerA closure to be executed once the download has finished.
nilby default.Return Value
The created
Cancellable. -
Creates a
UploadOperationfor the specifiedUploadableobject.Declaration
Swift
@discardableResult public func operation<T: Encodable>( parameters: T, uploadProgressHandler: ((Progress) -> Void, queue: DispatchQueue?)? = nil, completionQueue: DispatchQueue = .main, completionHandler: ((DataResponse<Response>) -> Void)? = nil ) throws -> UploadOperation<Self>Parameters
uploadProgressHandlerA closure to be executed once the upload progresses.
nilby default.completionHandlerA closure to be executed once the request has finished.
nilby default.Return Value
The created
UploadOperation. -
Creates a
UploadOperationfor the specifiedUploadableobject and asynchronously executes it.Declaration
Swift
@discardableResult public func enqueue<T: Encodable>( parameters: T, uploadProgressHandler: ((Progress) -> Void, queue: DispatchQueue?)? = nil, completionQueue: DispatchQueue = .main, completionHandler: ((DataResponse<Response>) -> Void)? = nil ) throws -> CancellableParameters
uploadProgressHandlerA closure to be executed once the upload progresses.
nilby default.completionHandlerA closure to be executed once the download has finished.
nilby default.Return Value
The created
Cancellable.
Uploadable Protocol Reference