Reputation: 247
i have searched about this error and i doesn't find useful. Here's my code:-
@IBAction func btnSave(_ sender:UIButton) {
let teamName=txt1.text
let memberCount = txt2.text
let postParameters = "name="+teamName!+"&member="+memberCount!;
Alamofire.request(URL_SAVE_TEAM,method:.post, parameters: postParameters, encoding: JSONEncoding.default).responseJSON { response in
print(response.request as Any) // original URL request
print(response.response as Any) // URL response
print(response.result.value as Any) // result of response serialization
}
}
Extra argument 'method' in call i am getting this error
Upvotes: 0
Views: 144
Reputation: 6611
change your postParameters
variable like below:
let postParamaters = ["name" : "teamName", "member" : "memberCount"]
Upvotes: 0
Reputation: 930
I have pass this argument and it will work fine. Try this:
let manager = Alamofire.SessionManager.default
manager.request(url, method: .post, parameters: param,headers: nil)
.responseJSON { response in
switch response.result {
case .success(_):
if let value = response.result.value
{ }
}
}
Upvotes: 1