-6

We are trying to get our iOS application to connect to our server.
We are using Swift 3.0.2 and Alamofire 4.4.0.
Every time I try to make an Alamofire.request, I get an error saying Extra argument in call.

I have looked online at various pages and articles including ones on Stack Overflow and have tried all sorts of troubleshooting techniques such as rearranging the terms inside the call, initializing the values outside the call etc.
All we are trying to do is send a specific number to our server every time a specific button is pressed (The buttons and numbers are synced, so when we press button 1, we want to send a '1' to the server, and so on).
Any help on how to proceed further?

Alamofire Error

GGamba
  • 13,140
  • 3
  • 38
  • 47
  • 2
    If I'm not mistaken, `AlamoFire.request` takes a `String` rather than a `NSURL` as an argument. https://github.com/Alamofire/Alamofire#http-methods – creeperspeak Mar 02 '17 at 22:53
  • 1
    You should add the code as a code snippet instead of photo. – Ahmad F Mar 02 '17 at 22:56
  • 1
    Possible duplicate of [Alamofire Swift 3.0 Extra parameter in call](http://stackoverflow.com/questions/39490839/alamofire-swift-3-0-extra-parameter-in-call) – Ahmad F Mar 02 '17 at 22:58

1 Answers1

0

Make sure you got the latest cocoapods . To check latest pod type pod --version in terminal and make sure its 1.2.0. Even you downloaded the latest Alamofire4 with cocoapods, if your cocoapods is not latest it sometimes download previous version of Alamofire. Check this first, after that use this format :

 Alamofire.request(url, method: .post, parameters: yourParameter, encoding: JSONEncoding.default, headers: nil)
        .responseJSON { (response) in


    }
Arafin Russell
  • 1,487
  • 1
  • 18
  • 37