I have migrated my project to Swift 3 (and updated Alamofire to latest Swift 3 version with pod 'Alamofire', '~> 4.0'
in the Podfile).
I now get an "Extra argument in call" error on every Alamofire.request. Eg:
let patientIdUrl = baseUrl + nextPatientIdUrl
Alamofire.request(.POST, patientIdUrl, parameters: nil, headers: nil, encoding: .JSON)
Can anybody tell me why ?
For me this is working.
For GET Request
For POST
Thanks @Rajan Maheswari.
I fixed this issue with:
Note that: Alamofire methods signature change in Swift 3
Two things that I found worth noting.
Alamofire.request("https://yourServiceURL.com", method: .post,
instead ofAlamofire.request(url: "https://yourServiceURL.com", method: .post,
.[String: String]
. Declare it explicitly.This error is up to parameters value. It has to be [String: String]