Migration from Alamofire 2 to Alamofire 4. Extra Argument in call (Request)

0

When I made the requests to the server I used the following code

let URL = Foundation.URL(string: "http:....")!
let mutableURLRequest = NSMutableURLRequest(url: URL)
mutableURLRequest.httpMethod = "POST"

let parameters = ["UserName": "Teste"]
  do{
    mutableURLRequest.httpBody = try JSONSerialization.data(withJSONObject: parameters, options: JSONSerialization.WritingOptions())
    }catch{}

mutableURLRequest.setValue("application/json", forHTTPHeaderField: "Content-Type")

Alamofire.request("https").responseJSON{response in....}
Now with the migration to swift 4 I have already tried the codes that are in the library document and I have tried other options that several users are giving here and in forums and I usually always have the same error as the following "Extra argument in call "

Someone with the same problem and I have been able to reach the solution can help me?

    
asked by anonymous 12.01.2017 / 11:08

1 answer

0

I was able to solve the problem of the "Extra Argument" error using the code I showed above but changed the NSMutableURLRequest to URLRequest

    
12.01.2017 / 13:34