I am trying to use RxAlamofire for Reactive requests. There is a method for creating POST
request with -
public func request(_ method: Alamofire.HTTPMethod,
_ url: URLConvertible,
parameters: [String: Any]? = nil,
encoding: ParameterEncoding = URLEncoding.default,
headers: [String: String]? = nil
)
But I cannot pass an Array [[String : Any]]
to the parameters for obvious reasons. So how do I create a request with this array as parameters?
Being more specific, I can pass
let student = ["firstName":"Mayur", "lastName":"Deshmukh"]
as a parameter because it is of type [String : Any]
But I cannot pass array like
let students = [["firstName":"Mayur", "lastName":"Deshmukh"],
["firstName":"Kaustubh", "lastName":"Deshmukh"]]
As now the type of students is [[String : Any]]
So does Alamofire or RxAlamofire have any handy method for creating requests with JSON Array as parameter? Or do we have to take a harder way?