0

I am migrating my code from Swift 2.3 to Swift 3. Before it was working fine after migrating I am facing extra argument method in call error. Any help is appreciable. I am very new to the Swift language.

func POST(url _url: String, params: [String : AnyObject]) -> Future<JSON, NSError> {
    let request = Alamofire.request(self.buildAppUrl(_url), method:.post, parameters: [params], encoding: JSONEncoding.default, headers: self.requestHeaders())  
}
Ryan H.
  • 2,543
  • 1
  • 15
  • 24
srinitha
  • 119
  • 10
  • Possible duplicate of [Extra argument 'method' in call](http://stackoverflow.com/questions/39571812/extra-argument-method-in-call) – Eric Aya Jan 04 '17 at 15:49
  • parameters is not array it is dictionary. – Nirav D Jan 04 '17 at 15:56
  • @NiravD,Please can you elaborate the answer. – srinitha Jan 04 '17 at 16:19
  • @srinitha It should be like `let request = Alamofire.request(self.buildAppUrl(_url), method:.post, parameters: params, encoding: JSONEncoding.default, headers: self.requestHeaders())` **Note:** Here params and requestHeaders() must be `Dictionary`. – Nirav D Jan 04 '17 at 16:27
  • params is Dictionary and requestHeaders() is variable,still am getting same error @NiravD – srinitha Jan 04 '17 at 16:38
  • @srinitha `self.requestHeaders()` is a function in your case, and what i'm saying is it should return Dictionary not some variable. – Nirav D Jan 04 '17 at 16:46

0 Answers0