I've been trying to resolve this error when I call Alamofire by fixing parameter types, changing the response-type from responseString
to responseJSON
and force-unwrapping variables. I've checked out the following answers and haven't had any luck:
Alamofire, Extra argument 'method' in call
Extra argument 'method' in call of Alamofire
Swift - Extra Argument in call
Swift 3.0, Alamofire 4.0 Extra argument 'method' in call
Here's my code:
func checkServerForLogin(email: String, password: String) {
let parameters = [
"email": email,
"password": password
] as [String : Any]
Alamofire.request(URL_CHECK_LOGIN, method: .post, parameters: parameters).responseString { (response) in
if response.result.error == nil {
guard let data = response.data else {
return
}
do {
print("LOGIN_RESULT")
print(response)
} catch {
print("ERROR: \(error)")
}
} else {
debugPrint(response.result.error as Any)
}
}
}
Then I call it...
AuthService.instance.checkServerForLogin(email: email_input, password: password_input) { response, error in
if ((response) != nil){
}
}
I keep receiving Extra argument 'password' in call
. Any help in resolving this would be greatly appreciated.