Extra argument 'method' in call

前端 未结 15 1701
你的背包
你的背包 2020-12-16 08:59

Getting error while calling Alamofire request method in the latest version(4.0.0).

The syntax is:

Alamofire.request(urlString,method: .post, parame         


        
15条回答
  •  暖寄归人
    2020-12-16 09:27

    I can only refer you to: https://github.com/Alamofire/Alamofire/issues/1508#issuecomment-246207682

    Basically, if one of your parameters is of the wrong type, the swift compiler will assume you're using request(urlRequest:URLRequestConvertible) and then, the method is an extra argument

    Go over that parameters again and make sure all is of correct type (Parameters?, ParameterEncoding, and HTTPHeaders)

提交回复
热议问题