Alamofire 4 URL Request parameter encoding to JSON Alamofire 4 URL Request parameter encoding to JSON json json

Alamofire 4 URL Request parameter encoding to JSON


I use this encoding syntax:

...method: .get,parameters: parameters,encoding: JSONEncoding.default,headers: nil,...

In your case, it could be like this:

let encoding = Alamofire.JSONEncoding.default

I was struggling with this issue too, until I found a simple example here:

https://github.com/Alamofire/Alamofire#json-encoding