Search code examples
swiftalamofire

Alamofire parameters conflict


I'm unable to perform PUT request with latest version of Alamofire.

This sample work :

Alamofire.request(endpoint, method: .put, parameters: nil, encoding: JSONEncoding.default, headers: headers)

But this :

Alamofire.request(endpoint, method: .put, parameters: parameters, encoding: JSONEncoding.default, headers: headers)

doesn't, i'm unable to compile and i get Extra argument 'method' in call error

Why putting a parameter do that ?


Solution

  • Seems like there is the problem with compiler that will say that there is extra argument when actually there is issue with types.

    You have to ensure that your parameters that you are sending correspond to function signature.