I am trying to make a post request with Alamofire 5. I have to use Dictionary<String, Any> for parameters. Because I am writing a wrapper for Alamofire. But it seems i can't be able to use Any object in a dictionary because Alamofire gives me a compiler error:
Value of protocol type 'Any' cannot conform to 'Encodable'; only struct/enum/class types can conform to protocols
What i've tried:
let encodedParameters = Dictionary<String, Any>
AF.request(url, method: .get, parameters: encodedParameters, headers: headers)
Some values will be string others will be integer in my dictionary. So i can't use constant type. How can i resolve this problem?