It's there any way to post JSON with progress in alamofire? what I need to do I have JSON which has base64 image string and some other parameters while requesting JSON I need to show Progress to end user, so anyone has an idea how to do it in Alamofire?
I have followed the below link, but it gives me a syntax error in Alamofire?
Alamofire POST request with progress
let parameters: [String: AnyObject] = ["key": "value" as AnyObject]
let mutableURLRequest = NSMutableURLRequest(url: URL(string: "url goes here")!)
mutableURLRequest.httpMethod = "POST"
let encodedURLRequest = try! Alamofire.URLEncoding.default.encode(mutableURLRequest as! URLRequestConvertible, with: parameters)
let data = encodedURLRequest.httpBody!
Alamofire.upload(mutableURLRequest, data)
.progress { _, totalBytesRead, totalBytesExpectedToRead in
print("ENTER .PROGRESSS")
print("\(totalBytesRead) of \(totalBytesExpectedToRead)")
}
.responseJSON { _, _, mydata, _ in
print(mydata)
}
It gives me below error
Cannot invoke 'upload' with an argument list of type '(NSMutableURLRequet, Data)