UploadRequest

open class UploadRequest : DataRequest

Specific type of Request that manages an underlying URLSessionUploadTask.

Properties

  • The request sent or to be sent to the server.

    Declaration

    Swift

    open override var request: URLRequest? { get }
  • The progress of uploading the payload to the server for the upload request.

    Declaration

    Swift

    open var uploadProgress: Progress { get }

Upload Progress

  • Sets a closure to be called periodically during the lifecycle of the UploadRequest as data is sent to the server.

    After the data is sent to the server, the progress(queue:closure:) APIs can be used to monitor the progress of data being read from the server.

    Declaration

    Swift

    @discardableResult
    open func uploadProgress(queue: DispatchQueue = DispatchQueue.main, closure: @escaping ProgressHandler) -> Self

    Parameters

    queue

    The dispatch queue to execute the closure on.

    closure

    The code to be executed periodically as data is sent to the server.

    Return Value

    The request.