I am trying to upload using alamofire, I am using the following code:
Alamofire.upload(urlRequest.0, to: urlRequest.1, method: .put)
.uploadProgress(queue: DispatchQueue.utility) { progress in
print("Upload Progress: \(progress.fractionCompleted)")
}
.responseJSON { response in
//Some code here
}
Where urlRequest
is a tuple: (URLConvertible, Data)
. I am getting the compiler error : "Ambiguous reference to member 'upload(_:to:method:headers:)'"
. Any ideas what I am doing wrong here? Any pointers would be really appreciated! Thanks!
You may need to add the headers
parameter:
Alamofire.upload(urlRequest.0, to: urlRequest.1, method: .put, headers: nil)
.uploadProgress { progress in
print("Upload Progress: \(progress.fractionCompleted)")
}
while a tuple's types should stand in this order: (Data, URLConvertible)