Describe the bug
File upload (or download) has confusing behaviour - function is async, but it returns Alamofire.UploadRequest.
Expected behavior
A1) function is synchronous, throws on failure and returns UploadRequest
func uploadWithMultipart(...) throws(NetworkError) -> UploadRequest
A2) function is synchronous, doesn't return, accepts a completion handler
func uploadWithMultipart(..., completionHandler: (Result) -> Void) throws(NetworkError)
B1) function is asynchronous, doesn't return, and ends after file upload/download is complete or throws
func uploadWithMutlipart(...) async throws(NetworkError)
B2) function is asynchronous, returns the result of upload/download operation after file upload/download is complete
func uploadWithMutlipart(...) async -> Result
Result => some, at the time of reporting unknown concrete result type. Can be from Alamofire/local enum/Swift's Result type etc.
Describe the bug
File upload (or download) has confusing behaviour - function is
async, but it returnsAlamofire.UploadRequest.Expected behavior
A1) function is synchronous, throws on failure and returns
UploadRequestA2) function is synchronous, doesn't return, accepts a completion handler
B1) function is asynchronous, doesn't return, and ends after file upload/download is complete or throws
B2) function is asynchronous, returns the result of upload/download operation after file upload/download is complete
Result => some, at the time of reporting unknown concrete result type. Can be from Alamofire/local enum/Swift's Result type etc.