Extra argument 'method' in call of Alamofire

前端 未结 1 669
礼貌的吻别
礼貌的吻别 2021-01-15 12:08

I\'ve searched for this issue and there are many answers available but none are solving. I\'ve defined parameters as:

let parameters = [
                \"na         


        
相关标签:
1条回答
  • 2021-01-15 13:03

    Change parameters type to [String : Any] as follow:

    let parameters = [
                    "name": username,
                    "mobile": "",
                    "email": email,
                    "password": "",
                    "blood_donor": "0",
                    "registration_id": defaults.string(forKey: "FCMToken"),
                    "platform": platform,
                    "appID": "3"
                ] as [String : Any]
    

    Not necessary: Remove encoding: URLEncoding() from param arguments, it may work without encoding.

    Here is discussion on same issue and resolution by Alamofire developer: https://github.com/Alamofire/Alamofire/issues?utf8=%E2%9C%93&q=extra%20argument

    0 讨论(0)
提交回复
热议问题